Skip to content

Commit

Permalink
add Couchbase VectorDB Support for AG2
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh-couchbase committed Dec 9, 2024
1 parent 9338c7a commit 629e878
Show file tree
Hide file tree
Showing 8 changed files with 1,142 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ jobs:
--health-retries 5
ports:
- 5432:5432
couchbase:
image: couchbase:enterprise-7.6.3
ports:
- "8091-8095:8091-8095"
- "11210:11210"
- "9102:9102"
healthcheck: # checks couchbase server is up
test: ["CMD", "curl", "-v", "http://localhost:8091/pools"]
interval: 20s
timeout: 20s
retries: 5
mongodb:
image: mongodb/mongodb-atlas-local:latest
ports:
Expand All @@ -111,6 +122,9 @@ jobs:
- name: Install mongodb when on linux
run: |
pip install -e .[retrievechat-mongodb]
- name: Install couchbase when on linux
run: |
pip install -e .[retrievechat-couchbase]
- name: Install unstructured when python-version is 3.9 and on linux
if: matrix.python-version == '3.9'
run: |
Expand Down
6 changes: 5 additions & 1 deletion autogen/agentchat/contrib/vectordb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class VectorDBFactory:
Factory class for creating vector databases.
"""

PREDEFINED_VECTOR_DB = ["chroma", "pgvector", "mongodb", "qdrant"]
PREDEFINED_VECTOR_DB = ["chroma", "pgvector", "mongodb", "qdrant", "couchbase"]

@staticmethod
def create_vector_db(db_type: str, **kwargs) -> VectorDB:
Expand Down Expand Up @@ -237,6 +237,10 @@ def create_vector_db(db_type: str, **kwargs) -> VectorDB:
from .qdrant import QdrantVectorDB

return QdrantVectorDB(**kwargs)
if db_type.lower() in ["couchbase", "couchbasedb", "capella"]:
from .couchbase import CouchbaseVectorDB

return CouchbaseVectorDB(**kwargs)
else:
raise ValueError(
f"Unsupported vector database type: {db_type}. Valid types are {VectorDBFactory.PREDEFINED_VECTOR_DB}."
Expand Down
Loading

0 comments on commit 629e878

Please sign in to comment.