> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/open-webui/open-webui/llms.txt
> Use this file to discover all available pages before exploring further.

# Vector Database Integrations

> Configure vector databases for RAG (Retrieval Augmented Generation)

## Overview

Open WebUI supports 9 vector database options for storing and retrieving document embeddings in RAG workflows. Choose based on your deployment requirements, scale, and features needed.

## Supported Vector Databases

<CardGroup cols={3}>
  <Card title="ChromaDB" icon="database">
    Default, embedded, zero-config
  </Card>

  <Card title="Qdrant" icon="server">
    High-performance, production-ready
  </Card>

  <Card title="Milvus" icon="network-wired">
    Scalable, cloud-native
  </Card>

  <Card title="PGVector" icon="database">
    PostgreSQL extension
  </Card>

  <Card title="Elasticsearch" icon="magnifying-glass">
    Full-text + vector search
  </Card>

  <Card title="OpenSearch" icon="magnifying-glass">
    Open source Elasticsearch alternative
  </Card>

  <Card title="Pinecone" icon="cloud">
    Managed cloud service
  </Card>

  <Card title="S3Vector" icon="cube">
    S3-backed vector storage
  </Card>

  <Card title="Oracle 23ai" icon="database">
    Oracle database with vector support
  </Card>
</CardGroup>

## ChromaDB (Default)

Embedded vector database with zero configuration.

### Configuration

ChromaDB works out of the box with no configuration:

```bash theme={null}
# Already included in requirements.txt
chromadb==1.4.1
```

*File: backend/requirements.txt:55*

### Features

* Zero configuration
* Embedded mode (no separate server)
* Automatic persistence
* Metadata filtering
* Hybrid search

### Use Cases

<Check>Single-server deployments</Check>
<Check>Development and testing</Check>
<Check>Small to medium datasets</Check>

## Qdrant

High-performance vector database optimized for production.

### Installation

<Steps>
  <Step title="Install Client">
    ```bash theme={null}
    # Already included in requirements.txt
    qdrant-client==1.16.2
    ```
  </Step>

  <Step title="Deploy Qdrant">
    <CodeGroup>
      ```bash Docker theme={null}
      docker run -p 6333:6333 \
        -v qdrant_storage:/qdrant/storage \
        qdrant/qdrant
      ```

      ```yaml Docker Compose theme={null}
      services:
        qdrant:
          image: qdrant/qdrant:latest
          ports:
            - "6333:6333"
          volumes:
            - qdrant_storage:/qdrant/storage
      ```

      ```bash Qdrant Cloud theme={null}
      # Use Qdrant Cloud URL and API key
      QDRANT_URL=https://xxx-xxx.aws.cloud.qdrant.io
      QDRANT_API_KEY=your-api-key
      ```
    </CodeGroup>
  </Step>

  <Step title="Configure Open WebUI">
    Set environment variables or configure in admin panel
  </Step>
</Steps>

### Configuration

```bash theme={null}
VECTOR_DB=qdrant
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=optional-api-key
```

### Features

* High performance
* Distributed deployment
* HNSW indexing
* Filtering and payload support
* Cloud-managed option

*File: backend/requirements.txt:123*

## Milvus

Scalable, cloud-native vector database.

### Installation

<Steps>
  <Step title="Install Client">
    ```bash theme={null}
    # Already included in requirements.txt
    pymilvus==2.6.8
    ```
  </Step>

  <Step title="Deploy Milvus">
    <CodeGroup>
      ```bash Docker Compose theme={null}
      # Download Milvus docker-compose.yml
      wget https://github.com/milvus-io/milvus/releases/download/v2.3.0/milvus-standalone-docker-compose.yml -O docker-compose.yml
      docker-compose up -d
      ```

      ```bash Kubernetes theme={null}
      helm repo add milvus https://milvus-io.github.io/milvus-helm/
      helm install milvus milvus/milvus
      ```

      ```bash Zilliz Cloud theme={null}
      # Use Zilliz Cloud (managed Milvus)
      MILVUS_URL=https://xxx.zillizcloud.com
      MILVUS_TOKEN=your-token
      ```
    </CodeGroup>
  </Step>
</Steps>

### Configuration

```bash theme={null}
VECTOR_DB=milvus
MILVUS_URL=http://localhost:19530
MILVUS_TOKEN=optional-token
```

### Features

* Horizontal scalability
* Multiple index types (HNSW, IVF, etc.)
* GPU acceleration support
* Time travel queries
* Partition support

*File: backend/requirements.txt:122*

## PGVector

PostgreSQL extension for vector similarity search.

### Installation

<Steps>
  <Step title="Install Dependencies">
    ```bash theme={null}
    # Already included in requirements.txt
    psycopg2-binary==2.9.11
    pgvector==0.4.2
    ```
  </Step>

  <Step title="Setup PostgreSQL with pgvector">
    <CodeGroup>
      ```sql PostgreSQL theme={null}
      -- Enable pgvector extension
      CREATE EXTENSION IF NOT EXISTS vector;
      ```

      ```bash Docker theme={null}
      docker run -d \
        -e POSTGRES_PASSWORD=postgres \
        -e POSTGRES_DB=openwebui \
        -p 5432:5432 \
        pgvector/pgvector:pg16
      ```
    </CodeGroup>
  </Step>
</Steps>

### Configuration

```bash theme={null}
VECTOR_DB=pgvector
DATABASE_URL=postgresql://user:password@localhost:5432/openwebui
```

### Features

* SQL-based queries
* ACID compliance
* Existing PostgreSQL infrastructure
* Familiar tooling
* Cost-effective

*File: backend/requirements.txt:116-117*

## Elasticsearch

Full-text search with vector capabilities.

### Installation

```bash theme={null}
# Already included in requirements.txt
elasticsearch==9.3.0
```

### Configuration

<CodeGroup>
  ```bash Self-Hosted theme={null}
  VECTOR_DB=elasticsearch
  ELASTICSEARCH_URL=http://localhost:9200
  ELASTICSEARCH_API_KEY=optional
  ```

  ```bash Elastic Cloud theme={null}
  VECTOR_DB=elasticsearch
  ELASTICSEARCH_URL=https://xxx.es.us-central1.gcp.cloud.es.io
  ELASTICSEARCH_API_KEY=your-api-key
  ```
</CodeGroup>

### Features

* Hybrid search (full-text + vector)
* Mature ecosystem
* Advanced analytics
* Scalable architecture

*File: backend/requirements.txt:125*

## OpenSearch

Open source alternative to Elasticsearch.

### Installation

```bash theme={null}
# Already included in requirements.txt
opensearch-py==3.1.0
```

### Configuration

```bash theme={null}
VECTOR_DB=opensearch
OPENSEARCH_URL=http://localhost:9200
OPENSEARCH_USERNAME=admin
OPENSEARCH_PASSWORD=admin
```

### Features

* k-NN plugin for vector search
* Apache 2.0 license
* AWS managed service available
* Compatible with Elasticsearch APIs

*File: backend/requirements.txt:57*

## Pinecone

Managed cloud vector database.

### Installation

```bash theme={null}
# Already included in requirements.txt
pinecone==6.0.2
```

### Configuration

```bash theme={null}
VECTOR_DB=pinecone
PINECONE_API_KEY=your-api-key
PINECONE_ENVIRONMENT=us-west1-gcp
PINECONE_INDEX=openwebui
```

### Features

* Fully managed
* No infrastructure management
* Auto-scaling
* Low latency
* Free tier available

*File: backend/requirements.txt:126*

## Oracle 23ai

Oracle Database with AI Vector Search.

### Installation

```bash theme={null}
# Already included in requirements.txt
oracledb==3.4.2
```

### Configuration

```bash theme={null}
VECTOR_DB=oracle
ORACLE_DSN=localhost:1521/FREEPDB1
ORACLE_USER=vector_user
ORACLE_PASSWORD=password
```

### Features

* Integrated with Oracle Database
* ACID transactions
* Enterprise features
* SQL-based vector search

*File: backend/requirements.txt:127*

## Configuration Comparison

| Database      | Setup Complexity | Performance     | Scalability   | Cost      |
| ------------- | ---------------- | --------------- | ------------- | --------- |
| ChromaDB      | ⭐ Easy           | ⭐⭐⭐ Good        | ⭐⭐ Medium     | Free      |
| Qdrant        | ⭐⭐ Medium        | ⭐⭐⭐⭐⭐ Excellent | ⭐⭐⭐⭐ High     | Free/Paid |
| Milvus        | ⭐⭐⭐ Complex      | ⭐⭐⭐⭐⭐ Excellent | ⭐⭐⭐⭐⭐ Highest | Free/Paid |
| PGVector      | ⭐⭐ Medium        | ⭐⭐⭐ Good        | ⭐⭐⭐ High      | Free      |
| Elasticsearch | ⭐⭐⭐ Complex      | ⭐⭐⭐⭐ Very Good  | ⭐⭐⭐⭐ High     | Free/Paid |
| OpenSearch    | ⭐⭐⭐ Complex      | ⭐⭐⭐⭐ Very Good  | ⭐⭐⭐⭐ High     | Free      |
| Pinecone      | ⭐ Easy           | ⭐⭐⭐⭐ Very Good  | ⭐⭐⭐⭐⭐ Highest | Paid      |
| Oracle 23ai   | ⭐⭐⭐ Complex      | ⭐⭐⭐⭐ Very Good  | ⭐⭐⭐⭐ High     | Paid      |

## Switching Vector Databases

<Warning>
  Switching vector databases will require re-indexing all documents.
  Existing embeddings are not automatically migrated.
</Warning>

<Steps>
  <Step title="Backup Data">
    Export your documents from the current database
  </Step>

  <Step title="Configure New Database">
    Update environment variables or admin settings
  </Step>

  <Step title="Restart Open WebUI">
    ```bash theme={null}
    docker restart open-webui
    ```
  </Step>

  <Step title="Re-index Documents">
    Upload documents again or trigger re-indexing
  </Step>
</Steps>

## RAG Configuration

### Embedding Models

Open WebUI uses embedding models to convert text to vectors:

```bash theme={null}
# Default sentence-transformers
sentence-transformers==5.2.2
```

Common models:

* `all-MiniLM-L6-v2` (default, 384 dims)
* `all-mpnet-base-v2` (768 dims)
* `text-embedding-3-small` (OpenAI, 1536 dims)

*File: backend/requirements.txt:60*

### Chunk Configuration

Control how documents are split:

```bash theme={null}
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
```

### Retrieval Settings

```bash theme={null}
TOP_K=5  # Number of chunks to retrieve
SIMILARITY_THRESHOLD=0.7  # Minimum similarity score
```

## Performance Tuning

<CardGroup cols={2}>
  <Card title="Index Type" icon="gauge-high">
    Choose appropriate index (HNSW, IVF, FLAT) based on dataset size
  </Card>

  <Card title="Dimension Reduction" icon="compress">
    Use smaller embedding models for better performance
  </Card>

  <Card title="Batch Processing" icon="layer-group">
    Index documents in batches for efficiency
  </Card>

  <Card title="Caching" icon="database">
    Enable result caching for repeated queries
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection Failed">
    1. Verify database is running: `docker ps` or check service status
    2. Check connection string/URL format
    3. Verify credentials (API key, username, password)
    4. Check network connectivity and firewall rules
    5. Review database logs for errors
  </Accordion>

  <Accordion title="Slow Queries">
    * Optimize index configuration
    * Reduce embedding dimensions
    * Decrease TOP\_K value
    * Add more resources to database
    * Enable caching
  </Accordion>

  <Accordion title="Out of Memory">
    * Use disk-based storage instead of in-memory
    * Reduce batch size during indexing
    * Scale database resources
    * Archive old/unused collections
  </Accordion>
</AccordionGroup>

## Best Practices

1. **Choose Based on Scale**:
   * Small datasets: ChromaDB
   * Medium: PGVector, Qdrant
   * Large: Milvus, Elasticsearch
   * Managed: Pinecone, Qdrant Cloud

2. **Monitor Performance**:
   * Track query latency
   * Monitor index size
   * Watch memory usage

3. **Backup Strategy**:
   * Regular database backups
   * Document source preservation
   * Embedding model versioning

4. **Security**:
   * Use authentication
   * Enable TLS/SSL
   * Network isolation
   * API key rotation

## References

* ChromaDB: [docs.trychroma.com](https://docs.trychroma.com)
* Qdrant: [qdrant.tech/documentation](https://qdrant.tech/documentation)
* Milvus: [milvus.io/docs](https://milvus.io/docs)
* PGVector: [github.com/pgvector/pgvector](https://github.com/pgvector/pgvector)
