Couchbase
Couchbase vector store for PraisonAI
Couchbase
Distributed NoSQL database with vector search capabilities.
Setup
pip install couchbaseDocker
docker run -d --name couchbase \
-p 8091-8096:8091-8096 \
-p 11210-11211:11210-11211 \
couchbase:latestQuick Start (Agent with Knowledge)
Use Couchbase as a knowledge store with an agent:
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)
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:
{
"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