Skip to main content

Azure CosmosDB checkpoint saver implementation for LangGraph

Project description

LangGraph Checkpoint CosmosDB

This project provides an implementation of a checkpoint saver for LangGraph using Azure CosmosDB.

Features

  • Save and retrieve langgraph checkpoints in Azure CosmosDB.
  • Suppports both sync and async saver functionality

Installation

To install the package, ensure you have Python 3.9 or higher, and run:

pip install langgraph-checkpoint-cosmosdb

Usage

Setting Up Environment

To use the CosmosDBSaver

  • You need to set CosmosDB endpoint and key if you want it to create your specified database and container.
export COSMOSDB_ENDPOINT='your_cosmosdb_endpoint'
export COSMOSDB_KEY='your_cosmosdb_key'
  • If database and container already exists then this can work via default RBAC credentials. Ex. az login or by setting TENANT_ID, CLIENT_ID and CLIENT_SECRET in environment.
    • For user-assigned managed identity, ensure AZURE_CLIENT_ID environment variable is set to the identity's client ID.
    • Note that in this case error will be thrown if database and container do not exist.

Import

from langgraph_checkpoint_cosmosdb import CosmosDBSaver

Initialize the saver

Database and Container is created if it does not exists

saver = CosmosDBSaver(database_name='your_database', container_name='your_container')

Limitations

List function does not support filters. You can only pass config on thread id to get the list.

print(list(memory.list(config=config)))

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph_checkpoint_cosmosdb-0.2.6.tar.gz (177.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langgraph_checkpoint_cosmosdb-0.2.6-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_checkpoint_cosmosdb-0.2.6.tar.gz.

File metadata

  • Download URL: langgraph_checkpoint_cosmosdb-0.2.6.tar.gz
  • Upload date:
  • Size: 177.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for langgraph_checkpoint_cosmosdb-0.2.6.tar.gz
Algorithm Hash digest
SHA256 365f83a960947a4eeae841f85a19f66d1aefdf8196c7cee05595dbe3594b94d3
MD5 90df7ab84ec4e4cbbed89d3fb93ac373
BLAKE2b-256 a62645c4f42d1c06bf0a9825b8af6b6f90d373ec324548b5f4168e0cf19211a5

See more details on using hashes here.

File details

Details for the file langgraph_checkpoint_cosmosdb-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: langgraph_checkpoint_cosmosdb-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for langgraph_checkpoint_cosmosdb-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 57b329d014b14c30e4ff72ad002de492bc0a6948b07d465e019c4ee70161139b
MD5 2488be8f05149136bbc6ac4737c68013
BLAKE2b-256 35e2d9dac9f4a5dd944512f388a96ec295c26c475ac47a72f1c32a215a3e857b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page