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.2.tar.gz (60.4 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.2-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cellstate-0.5.2.tar.gz
  • Upload date:
  • Size: 60.4 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.2.tar.gz
Algorithm Hash digest
SHA256 5b5adbc0b43d014681908a2a4e0635614dfd1a662a4567ba1a84581d4a894d94
MD5 b5d3afd2f4b392ca7259aeafedf94ff4
BLAKE2b-256 ed7569417cda611b148a913166dd8bcf2a50a01e1440866058e71df3a8be2e66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cellstate-0.5.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b14114fdc76291399a043bfcd4e1aa7609f8c9c4badfdc25f4f99aaa140dcfaf
MD5 697ddba10a4303360f36d2486b84dfe7
BLAKE2b-256 dfb1ca2f63040b19e59bded55684c64de26f0057e37c2b33a922797328474301

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