> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Couchbase

> Couchbase vector store for PraisonAI

# Couchbase

Distributed NoSQL database with vector search capabilities.

## Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install couchbase
```

## Docker

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
docker run -d --name couchbase \
  -p 8091-8096:8091-8096 \
  -p 11210-11211:11210-11211 \
  couchbase:latest
```

## Quick Start (Agent with Knowledge)

Use Couchbase as a knowledge store with an agent:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant with access to documents.",
    knowledge=["./docs/guide.pdf"]
)

agent.chat("What does the guide say?")
```

## Advanced Usage (Direct Store)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.persistence.factory import create_knowledge_store

store = create_knowledge_store(
    "couchbase",
    connection_string="couchbase://localhost",
    username="Administrator",
    password="password",
    bucket_name="praisonai"
)
```

## Configuration

| Option              | Description                          |
| ------------------- | ------------------------------------ |
| `connection_string` | Couchbase connection string          |
| `username`          | Couchbase username                   |
| `password`          | Couchbase password                   |
| `bucket_name`       | Bucket name                          |
| `scope_name`        | Scope name (default: `_default`)     |
| `collection_name`   | Collection name (default: `vectors`) |
| `index_name`        | Vector search index name             |
| `embedding_dim`     | Embedding dimension (default: 1536)  |

## Vector Search Index

Create a vector search index via Couchbase UI or API:

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "type": "fulltext-index",
  "name": "vector_index",
  "sourceType": "couchbase",
  "sourceName": "praisonai",
  "planParams": {
    "indexPartitions": 1
  },
  "params": {
    "mapping": {
      "types": {
        "vectors": {
          "properties": {
            "embedding": {
              "enabled": true,
              "dynamic": false,
              "fields": [{
                "dims": 1536,
                "similarity": "dot_product",
                "type": "vector"
              }]
            }
          }
        }
      }
    }
  }
}
```

## Best For

* High-performance distributed deployments
* Multi-model database needs
* Edge computing scenarios
