langchain/docs/docs/integrations
fatmelon d1e0ec7b55
community: VectorStores: Azure Cosmos DB Mongo vCore with DiskANN (#27329)
# Description
Add a new vector index type `diskann` to Azure Cosmos DB Mongo vCore
vector store. Paper of DiskANN can be found here [DiskANN: Fast Accurate
Billion-point Nearest Neighbor Search on a Single
Node](https://proceedings.neurips.cc/paper_files/paper/2019/file/09853c7fb1d3f8ee67a61b6bf4a7f8e6-Paper.pdf).

## Sample Usage
```python
from pymongo import MongoClient

# INDEX_NAME = "izzy-test-index-2"
# NAMESPACE = "izzy_test_db.izzy_test_collection"
# DB_NAME, COLLECTION_NAME = NAMESPACE.split(".")

client: MongoClient = MongoClient(CONNECTION_STRING)
collection = client[DB_NAME][COLLECTION_NAME]

model_deployment = os.getenv(
    "OPENAI_EMBEDDINGS_DEPLOYMENT", "smart-agent-embedding-ada"
)
model_name = os.getenv("OPENAI_EMBEDDINGS_MODEL_NAME", "text-embedding-ada-002")

vectorstore = AzureCosmosDBVectorSearch.from_documents(
    docs,
    openai_embeddings,
    collection=collection,
    index_name=INDEX_NAME,
)

# Read more about these variables in detail here. https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/vector-search
maxDegree = 40
dimensions = 1536
similarity_algorithm = CosmosDBSimilarityType.COS
kind = CosmosDBVectorSearchType.VECTOR_DISKANN
lBuild = 20

vectorstore.create_index(
            dimensions=dimensions,
            similarity=similarity_algorithm,
            kind=kind ,
            max_degree=maxDegree,
            l_build=lBuild,
        )
```

## Dependencies
No additional dependencies were added

---------

Co-authored-by: Yang Qiao (from Dev Box) <yangqiao@microsoft.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-12-12 01:54:04 +00:00
..
adapters docs[patch]: Make Docusaurus and Vercel add trailing slashes when navigating by default (#20014) 2024-04-04 12:49:15 -07:00
caches [docs]: update Redis (langchain-redis) documentation notebooks (vectorstore, llm caching, chat message history) (#25113) 2024-08-22 11:53:02 -04:00
callbacks docs: update uptrain.ipynb (#28561) 2024-12-06 19:09:48 -05:00
chat docs: Update IBM documentation (#28503) 2024-12-08 12:40:29 -08:00
chat_loaders multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
document_loaders docs: more api ref links, add linting step to prevent more (#28495) 2024-12-04 04:19:42 +00:00
document_transformers community: add InfinityRerank (#27043) 2024-11-06 17:26:30 -08:00
graphs community: update Memgraph integration (#27017) 2024-12-10 10:57:21 -05:00
llms docs: more api ref links, add linting step to prevent more (#28495) 2024-12-04 04:19:42 +00:00
memory community[patch]: Neo4j community deprecation (#28130) 2024-11-25 10:34:22 -08:00
providers docs: provider list from packages.yml (#28677) 2024-12-12 00:12:30 +00:00
retrievers langchain-weaviate: Remove outdated docs (#28058) 2024-12-10 05:00:07 +00:00
stores concepts: update llm stub page and re-link (#27567) 2024-10-22 23:03:36 -04:00
text_embedding community[minor]: Add support for modle2vec embeddings (#28507) 2024-12-09 02:17:22 +00:00
tools docs: add Linkup integration documentation (#28366) 2024-12-09 14:36:25 -08:00
vectorstores community: VectorStores: Azure Cosmos DB Mongo vCore with DiskANN (#27329) 2024-12-12 01:54:04 +00:00
llm_caching.ipynb community: Memcached LLM Cache Integration (#27323) 2024-11-07 03:07:59 +00:00