AsyncCosmosDBStore(
self,
conn: AsyncCosmosClient,
*,
database_name: str = 'langgraph',
container_name: strAsyncBatchedBaseStoreBaseCosmosDBStore[AsyncCosmosClient]Async Azure Cosmos DB-backed store with optional vector search.
Provides async LangGraph long-term memory persistence using Azure Cosmos DB.
Example:
Basic setup and usage::
from langchain_azure_cosmosdb import AsyncCosmosDBStore
async with AsyncCosmosDBStore.from_conn_string( conn_string="AccountEndpoint=https://...;AccountKey=...", database_name="langgraph", container_name="store", ) as store: await store.setup() await store.aput(("users", "123"), "prefs", {"theme": "dark"}) item = await store.aget(("users", "123"), "prefs")
Note:
Semantic search is disabled by default. Provide an index
configuration when creating the store to enable it.
Warning:
Make sure to call setup() before first use.