Azure Cosmos DB integrations for LangChain and LangGraph: vector stores, semantic caches, chat message history, stores, and checkpointers.
Sync classes are importable from langchain_azure_cosmosdb; their async counterparts live in langchain_azure_cosmosdb.aio.
This page contains reference documentation for Azure Cosmos DB. See the docs for conceptual guides, tutorials, and examples.
Cosmos DB Similarity Type as enumerator.
Cosmos DB Vector Search Type as enumerator.
Cosmos DB Vector Search Compression as enumerator.
Azure DocumentDB (with MongoDB compatibility) vector store.
To use, you should have both:
pymongo python package installedpymongo.collection.Collection for an AzurAzure Cosmos DB for NoSQL vector store.
To use, you should have both:
- the azure-cosmos python package installed
You can read more about vector search, full text search and hybrid search
Retriever that uses Azure CosmosDB No Sql Search.
Enumerator of the Distance strategies for calculating distances.
Aggregated request charge for one logical Cosmos DB operation.
Accumulate request charges supplied by Cosmos SDK response hooks.
A visitor that converts a StructuredQuery into a CosmosDB NoSQL query.
Configuration for vector embeddings in Cosmos DB store.
Extends IndexConfig with Cosmos DB-specific vector search options.
Shared query/logic between sync and async Cosmos DB stores.
Azure Cosmos DB-backed store with optional vector search.
Provides LangGraph long-term memory persistence using Azure Cosmos DB.
CosmosDB synchronous implementation of BaseCheckpointSaver.
Uses environment variables for connection configuration.
Synchronous CosmosDB implementation of LangGraph BaseCache.
Uses environment variables for connection configuration.
Chat message history backed by Azure CosmosDB.
Cache that uses Cosmos DB NoSQL backend.
Azure Cosmos DB for NoSQL async vector store.
To use, you should have both:
- the azure-cosmos python package installed
You can read more about vector search, full text search and hybrid s
Async retriever that uses Azure CosmosDB No Sql Search.
Async Azure Cosmos DB-backed store with optional vector search.
Provides async LangGraph long-term memory persistence using Azure Cosmos DB.
Asynchronous CosmosDB implementation of BaseCheckpointSaver.
Uses the native azure.cosmos.aio async client for non-blocking I/O.
Sync methods (get_tuple, list, put, put_writes)
ar
Asynchronous CosmosDB implementation of LangGraph BaseCache.
Uses the native azure.cosmos.aio async client for non-blocking I/O.
Sync methods (get, set, clear) delegate to the async
i
Async chat message history backed by Azure CosmosDB.
Async cache that uses Cosmos DB NoSQL backend.
Extract partition key paths from a partition key definition.
Supports:
azure.cosmos.PartitionKey instances with a single-path Hash /
MultiHash-of-one configuration. Hierarchical partExtract the partition-key value for item given its key paths.
Row-wise cosine similarity between two equal-width matrices.
Calculate maximal marginal relevance.
Filter out metadata types that are not supported for a vector store.