Skip to main content

Aerospike-based store base for LangGraph

Project description

LangGraph Store Aerospike

Store LangGraph state and data in Aerospike using the provided AerospikeStore.

Installation

pip install -U langgraph-store-aerospike

Usage

  1. Bring up Aerospike locally using prebuilt Aerospike Docker Image:
docker run -d --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server
  1. Point the store at your cluster (Default):

    • AEROSPIKE_HOST=127.0.0.1
    • AEROSPIKE_PORT=3000
    • AEROSPIKE_NAMESPACE=langgraph (default namespace for the store)
    • AEROSPIKE_SET=store (default set name)
  2. Use in your application:

   import aerospike
   from langgraph.store.aerospike import AerospikeStore
   from langgraph.store.base import PutOp, GetOp, SearchOp

   client = aerospike.client({"hosts": [("127.0.0.1", 3000)]}).connect()

   store = AerospikeStore(
       client=client,
       namespace="test",
       set="langgraph_store"
   )
   store.put(
       namespace=("users", "profiles"),
       key="user_123",
       value={"name": "Alice", "age": 30}
   )

   # Get data
   item = store.get(namespace=("users", "profiles"), key="user_123")
   print(item.value)  # {"name": "Alice", "age": 30}

   # Batch operations
   ops = [
       PutOp(namespace=("documents",), key="doc1", value={"status": "draft"}),
       PutOp(namespace=("documents",), key="doc2", value={"status": "published"}),
       GetOp(namespace=("documents",), key="doc1"),
   ]
   results = store.batch(ops)

   # Search with filters
   search_results = store.search(
       namespace_prefix=("documents",),
       filter={"status": {"$eq": "draft"}},
       limit=10
   )

   # Delete item
   store.delete(namespace=("users", "profiles"), key="user_123")

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_store_aerospike-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

langgraph_store_aerospike-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_store_aerospike-0.1.0.tar.gz.

File metadata

File hashes

Hashes for langgraph_store_aerospike-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e3b69c666f9ab286930d937ba343db058f68302992993280eef55e2c867be1e
MD5 397a35becb508f6bd6b219b8937d91ec
BLAKE2b-256 a7cc63248e91f668beda9823b53b3d24e061beb3349e1e24280c88bc0fa37498

See more details on using hashes here.

File details

Details for the file langgraph_store_aerospike-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_store_aerospike-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a517e8e4aa82605117c02682f7a0c10c9e178f08e0b7866b900f70aebd669b76
MD5 172eb9d823629e0519790fe2b2052bdc
BLAKE2b-256 c0b61c9f7f0ba68b7283142d582c392e46346a288d80c82c6d1a156561d2ebe0

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