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.

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.
    • 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.3.tar.gz (7.2 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.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for langgraph_checkpoint_cosmosdb-0.2.3.tar.gz
Algorithm Hash digest
SHA256 f2287c040fdbf23cd335d122a089e2e2065e9c503595d9f8ef03a4ba536f567a
MD5 fd0486507d8498e87ef9577fb4acc524
BLAKE2b-256 1ef91936cb51face16b0df2c5e1a69a60bb1330fbaf46f239d3e055b097133e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langgraph_checkpoint_cosmosdb-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2c9e668b56bd71403a774c90c8e0de4e7e11f138ec78769b33fbbf665858b314
MD5 a7b4c302b10f0c90a582e34571fe4e75
BLAKE2b-256 26a06630039d83256e281e9321d16a1068d00f4464608c8a6dfe8ad470c86e9c

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