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

Adding vector store for Azure Cosmos DB NoSql #14158

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gsa9989
Copy link

@gsa9989 gsa9989 commented Jun 14, 2024

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # 14159
Added vector store capabilities with Azure Cosmos DB NoSql by creating AzureCosmosDBNoSqlVectorSearch class as well as tests for adding to the class and query.

Read more about this: https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/vector-search

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@gsa9989 gsa9989 marked this pull request as ready for review July 2, 2024 22:34
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jul 2, 2024
@gsa9989 gsa9989 changed the title Initial changes Jul 2, 2024
@aayush3011
Copy link

@logan-markewich can you please review this PR.

Copy link

@simorenoh simorenoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job Gaby! Just need to clean up a bit and I had one pending question.

Comment on lines 183 to 184
# print("This is node")
# print(node)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover print statements - these are not the only ones, let's make sure to remove those altogether from the entire file

Comment on lines 34 to 36
"Requirement already satisfied: httpx in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-openai) (0.27.0)\n",
"Requirement already satisfied: llamaindex-py-client<0.2.0,>=0.1.18 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-openai) (0.1.19)\n",
"Requirement already satisfied: nest-asyncio<2.0.0,>=1.5.8 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index-core<0.11.0,>=0.10.1->llama-index-embeddings-openai) (1.6.0)\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of these should be removed

Comment on lines 171 to 174
"Requirement already satisfied: llama-index-llms-openai<0.2.0,>=0.1.13 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index) (0.1.22)\n",
"Requirement already satisfied: llama-index-multi-modal-llms-openai<0.2.0,>=0.1.3 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index) (0.1.6)\n",
"Requirement already satisfied: llama-index-program-openai<0.2.0,>=0.1.3 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index) (0.1.6)\n",
"Requirement already satisfied: llama-index-question-gen-openai<0.2.0,>=0.1.2 in c:\\users\\t-garagundi\\appdata\\local\\programs\\python\\python312\\lib\\site-packages (from llama-index) (0.1.3)\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

for item in self._container.query_items(
query='SELECT TOP @k c.id, c.embedding, c.text, c.metadata, VectorDistance(c.embedding,@embedding) AS SimilarityScore FROM c ORDER BY VectorDistance(c.embedding,@embedding)',
parameters=[{"name": "@k", "value": params['k']},
# {"name": "@embedding_key", "value": params["path"]},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment needed?

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 12, 2024
@aayush3011
Copy link

@seldo @nerdai please review this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
3 participants