Skip to main content

Python SDK for CELLSTATE -- the memory & orchestration layer for AI agents

Project description

cellstate

Python SDK for CELLSTATE -- the memory and orchestration layer for AI agents.

Installation

pip install cellstate

With framework adapters:

pip install cellstate[langgraph]    # LangGraph checkpointer
pip install cellstate[langmem]      # LangMem memory store
pip install cellstate[pydantic-ai]  # PydanticAI state
pip install cellstate[all]          # Everything

Quick Start

from cellstate import CellstateClient

client = CellstateClient(
    api_key="cst_...",
    tenant_id="your-tenant-id",
)

# Create a trajectory (task container)
trajectory = await client.trajectories.create(
    name="Build feature X",
    description="Implement the new feature",
)

# Create a scope (context window)
scope = await client.scopes.create(
    trajectory_id=trajectory["trajectory_id"],
    name="Implementation",
    token_budget=8000,
)

# Store an artifact
artifact = await client.artifacts.create(
    trajectory_id=trajectory["trajectory_id"],
    scope_id=scope["scope_id"],
    artifact_type="Code",
    name="feature.py",
    content="def feature(): ...",
    source_turn=1,
    extraction_method="Explicit",
    ttl="Persistent",
)

Framework Adapters

LangGraph

from cellstate.adapters.langgraph import CellstateCheckpointer

checkpointer = CellstateCheckpointer(
    api_key="cst_...",
    tenant_id="...",
)
graph = StateGraph(State)
graph.compile(checkpointer=checkpointer)

LangMem

from cellstate.adapters.langmem import CellstateMemoryStore

store = CellstateMemoryStore(api_key="cst_...", tenant_id="...")
await store.add_memory("User prefers dark mode")
results = await store.search_memories("UI preferences")

Adapter Conformance Guardrails

Adapter layering and surface-area drift are enforced by tests:

  • tests/test_adapter_conformance.py checks module complexity budgets.
  • Public adapter method surfaces are pinned to golden fixtures.
  • Allowed self.client.<manager> usage is pinned per adapter module.

Golden fixture location:

  • tests/fixtures/adapter_protocol_golden.json

When intentionally changing adapter APIs or architecture, update the fixture in the same PR so drift is explicit and reviewable.

License

Apache-2.0

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

cellstate-0.5.7.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

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

cellstate-0.5.7-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

Details for the file cellstate-0.5.7.tar.gz.

File metadata

  • Download URL: cellstate-0.5.7.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for cellstate-0.5.7.tar.gz
Algorithm Hash digest
SHA256 3ba4dbe93c533ea9f72ff6ec6c88b979c5698f9c305df38eaac4970bb261605c
MD5 27eab0874beeb907a0a38d39aafa7f1b
BLAKE2b-256 743e8df892b182d3ee31e15e9243d4d7124f873a4159a24cd97fc3bed1a9487d

See more details on using hashes here.

File details

Details for the file cellstate-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: cellstate-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 74.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for cellstate-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e698e38c9d2cf5e7a66051bae2240a3f0814bc804b89c4f322960c4b56ba03bf
MD5 136e96506dfb879183ca415aaac93798
BLAKE2b-256 08cbeca76c9f1357bf4c53f02897aec3dde0858d5207b83bc2348cd7c96e113e

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