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.6.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.6-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cellstate-0.5.6.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.6.tar.gz
Algorithm Hash digest
SHA256 f84853f05a1bd28be039921de0aa4502bdc07e9800325749f9db808571dbb32f
MD5 fc1e160e092e6a0eb8094b24e30e02f8
BLAKE2b-256 0e3b2488956d1544671f5c179ce063d6b7430c6338f2ccc4e9b3cead899ba949

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cellstate-0.5.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 60ff02eb259955e072ef2d584dcaf372e39714f878311cc5932c781a04e8639a
MD5 f27edcf3e8553595ac39607c6820de69
BLAKE2b-256 8db4a4c18362874b58af32c5a84121fab99d00954afd2d9a1f7fe0724c3969ef

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