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

# Vector Databases

> Store embeddings and search for similar content.

Vector databases store content as embeddings and enable similarity search. When an agent searches the knowledge base, the query is converted to an embedding and matched against stored vectors to find relevant content.

## How It Works

<Steps>
  <Step title="Chunk">
    Documents are split into smaller pieces for more precise retrieval.
  </Step>

  <Step title="Embed">
    Each chunk is converted to a vector embedding and stored in the database.
  </Step>

  <Step title="Search">
    Queries are embedded and matched against stored vectors to find similar content.
  </Step>
</Steps>

## Hybrid Search

Many vector databases support hybrid search, combining vector similarity with keyword matching. This improves results for queries that benefit from both semantic understanding and exact term matching.

Hybrid search works by:

1. Finding semantically similar content via vector search
2. Finding keyword matches via full-text search
3. Combining results using ranked fusion

## Supported Databases

<CardGroup cols={3}>
  <Card title="Azure Cosmos DB" icon="database" iconType="duotone" href="/knowledge/vector-stores/azure_cosmos_mongodb/overview">
    MongoDB vCore vector search
  </Card>

  <Card title="Cassandra" icon="database" iconType="duotone" href="/knowledge/vector-stores/cassandra/overview">
    Distributed database with vector search
  </Card>

  <Card title="Chroma" icon="database" iconType="duotone" href="/knowledge/vector-stores/chroma/overview">
    Open-source embedding database
  </Card>

  <Card title="ClickHouse" icon="database" iconType="duotone" href="/knowledge/vector-stores/clickhouse/overview">
    Analytical database with vector search
  </Card>

  <Card title="Couchbase" icon="database" iconType="duotone" href="/knowledge/vector-stores/couchbase/overview">
    NoSQL with vector search
  </Card>

  <Card title="LanceDB" icon="database" iconType="duotone" href="/knowledge/vector-stores/lancedb/overview">
    Local, serverless, hybrid search
  </Card>

  <Card title="LangChain" icon="link" iconType="duotone" href="/knowledge/vector-stores/langchain/overview">
    Use any LangChain vector store
  </Card>

  <Card title="LightRAG" icon="lightbulb" iconType="duotone" href="/knowledge/vector-stores/lightrag/overview">
    Graph-based RAG
  </Card>

  <Card title="Milvus" icon="database" iconType="duotone" href="/knowledge/vector-stores/milvus/overview">
    Scalable vector database
  </Card>

  <Card title="MongoDB" icon="database" iconType="duotone" href="/knowledge/vector-stores/mongodb/overview">
    Atlas vector search
  </Card>

  <Card title="PgVector" icon="database" iconType="duotone" href="/knowledge/vector-stores/pgvector/overview">
    PostgreSQL extension, hybrid search
  </Card>

  <Card title="Pinecone" icon="cloud" iconType="duotone" href="/knowledge/vector-stores/pinecone/overview">
    Managed vector database
  </Card>

  <Card title="Qdrant" icon="database" iconType="duotone" href="/knowledge/vector-stores/qdrant/overview">
    High-performance vector search
  </Card>

  <Card title="Redis" icon="database" iconType="duotone" href="/knowledge/vector-stores/redis/overview">
    In-memory with vector search
  </Card>

  <Card title="SingleStore" icon="database" iconType="duotone" href="/knowledge/vector-stores/singlestore/overview">
    Real-time analytics with vectors
  </Card>

  <Card title="SurrealDB" icon="database" iconType="duotone" href="/knowledge/vector-stores/surrealdb/overview">
    Multi-model database
  </Card>

  <Card title="Upstash" icon="cloud" iconType="duotone" href="/knowledge/vector-stores/upstash/overview">
    Serverless vector search
  </Card>

  <Card title="Weaviate" icon="database" iconType="duotone" href="/knowledge/vector-stores/weaviate/overview">
    Vector search with modules
  </Card>
</CardGroup>

## Choosing a Database

<CardGroup cols={2}>
  <Card title="Local Development" icon="laptop-code" href="/knowledge/vector-stores/lancedb/overview">
    **LanceDB** or **ChromaDB** for zero-setup local development
  </Card>

  <Card title="Production" icon="server" href="/knowledge/vector-stores/pgvector/overview">
    **PgVector** if you already use PostgreSQL
  </Card>

  <Card title="Managed Service" icon="cloud" href="/knowledge/vector-stores/pinecone/overview">
    **Pinecone** or **Weaviate Cloud** for no-ops deployment
  </Card>

  <Card title="High Performance" icon="gauge" href="/knowledge/vector-stores/qdrant/overview">
    **Qdrant** or **Milvus** for large-scale search
  </Card>
</CardGroup>

## Async Support

Vector databases with async support enable non-blocking operations for better performance in production. Use `ainsert` and `asearch` methods when building async agents.

```python theme={null}
# Async insert
await knowledge.ainsert(url="https://example.com/docs.pdf")

# Async search
results = await knowledge.asearch(query="How do I configure X?")
```
