-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Python: Azure Cosmos DB NoSQL Vector Store & Collection implementation #9296
base: main
Are you sure you want to change the base?
Python: Azure Cosmos DB NoSQL Vector Store & Collection implementation #9296
Conversation
python/semantic_kernel/connectors/memory/azure_cosmosdb_no_sql/azure_cosmos_db_no_sql_base.py
Outdated
Show resolved
Hide resolved
...semantic_kernel/connectors/memory/azure_cosmosdb_no_sql/azure_cosmos_db_no_sql_collection.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of small comments
...semantic_kernel/connectors/memory/azure_cosmosdb_no_sql/azure_cosmos_db_no_sql_collection.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmosdb_no_sql/utils.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmosdb_no_sql/azure_cosmos_db_no_sql_base.py
Outdated
Show resolved
Hide resolved
create_database (bool): If True, the database will be created if it does not exist. | ||
Defaults to False. | ||
""" | ||
super().__init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've introduced a concept called managed_client
in VectorStore and VectorStoreRecordCollection, this together with a context manager can be used to make sure we cleanup what we create, but not what someone else created, so have a look at Azure AI Search for the mechanics!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Azure AI Search actually uses two clients (one for the service, one for an index) so it introduces a additional one, that can be applied to the database creation
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_base.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_collection.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_collection.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_collection.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_collection.py
Show resolved
Hide resolved
python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_no_sql_collection.py
Show resolved
Hide resolved
if isinstance(field, VectorStoreRecordVectorField): | ||
vector_embedding_policy["vectorEmbeddings"].append({ | ||
"path": f'/"{field.name}"', | ||
"dataType": "float32", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a vector field can also have Int as the datatype, which would map toint8
: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/vector-search#vector-indexing-policies
Motivation and Context
We are implementing the Azure Cosmos DB NoSQL vector store and vector collection.
Description
Azure Cosmos DB NoSQL vector store & collection implementation.
Contribution Checklist