Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+mdb atlas vectordb [clean_final] #3000

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
28a009b
+mdb atlas
Jun 22, 2024
383168e
Update test/agentchat/contrib/vectordb/test_mongodb.py
ranfysvalle02 Jun 22, 2024
f531568
update test_mongodb.py; we dont need to do the assert .collection_nam…
Jun 22, 2024
a1c385c
Try fix mongodb service
thinkall Jun 22, 2024
bb1a183
Try fix mongodb service
thinkall Jun 22, 2024
1e30425
Update username and password
thinkall Jun 22, 2024
1d6dbaf
Merge branch 'main' into main
thinkall Jun 22, 2024
e0f3c59
Update autogen/agentchat/contrib/vectordb/mongodb.py
thinkall Jun 22, 2024
d6a1162
closer --- but im not super thrilled about the solution...
Jun 23, 2024
334cc25
Merge branch 'main' into main
thinkall Jun 24, 2024
de48057
PYTHON-4506 Expanded tests and simplified vector search pipelines
caseyclements Jun 24, 2024
f5e5fdf
Merge branch 'main' into pull/3000
ranfysvalle02 Jun 24, 2024
6245c30
Merge pull request #1 from caseyclements/pull/3000
ranfysvalle02 Jun 24, 2024
a367426
Update mongodb.py
ranfysvalle02 Jun 24, 2024
ffa3e38
Update mongodb.py - Casey
ranfysvalle02 Jun 24, 2024
d741ef6
Merge branch 'main' into main
ranfysvalle02 Jun 27, 2024
d2fbd02
Merge branch 'main' into main
ranfysvalle02 Jun 30, 2024
3646d1e
search_index_magic
Jun 30, 2024
3e0ac8e
Fix format
thinkall Jun 30, 2024
95e2f79
Fix tests
thinkall Jun 30, 2024
64a157c
hacking trying to figure this out
Jul 1, 2024
17d02d1
Merge branch 'main' of https://github.com/ranfysvalle02/autogen
Jul 1, 2024
6cfb689
Merge branch 'main' into main
thinkall Jul 2, 2024
66e46e8
Merge branch 'main' into main
thinkall Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ jobs:
--health-retries 5
ports:
- 5432:5432
mongodb:
image: mongodb/mongodb-atlas-local:latest
ports:
- 27017:27017
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -102,6 +106,9 @@ jobs:
- name: Install pgvector when on linux
run: |
pip install -e .[retrievechat-pgvector]
- name: Install mongodb when on linux
run: |
pip install -e .[retrievechat-mongodb]
- name: Install unstructured when python-version is 3.9 and on linux
if: matrix.python-version == '3.9'
run: |
Expand Down
9 changes: 7 additions & 2 deletions autogen/agentchat/contrib/vectordb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def get_docs_by_ids(
ids: List[ItemID] | A list of document ids. If None, will return all the documents. Default is None.
collection_name: str | The name of the collection. Default is None.
include: List[str] | The fields to include. Default is None.
If None, will include ["metadatas", "documents"], ids will always be included.
If None, will include ["metadatas", "documents"], ids will always be included. This may differ
depending on the implementation.
kwargs: dict | Additional keyword arguments.

Returns:
Expand All @@ -185,7 +186,7 @@ class VectorDBFactory:
Factory class for creating vector databases.
"""

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

@staticmethod
def create_vector_db(db_type: str, **kwargs) -> VectorDB:
Expand All @@ -207,6 +208,10 @@ def create_vector_db(db_type: str, **kwargs) -> VectorDB:
from .pgvectordb import PGVectorDB

return PGVectorDB(**kwargs)
if db_type.lower() in ["mdb", "mongodb", "atlas"]:
from .mongodb import MongoDBAtlasVectorDB

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