Skip to main content

agent-state-api

StateSync — the global state database for AI coding agents.

Two lines. Any agent. Persistent memory.

📚 Full documentation → · 🚀 Quickstart · 🔑 Get an API key · 💬 MCP guide


pip install agent-state-api
from agent_state import StateSync

sync = StateSync(api_key="ss_live_...")               # 1

sync.checkpoint(project="my-app", messages=history)    # 2a
ctx = sync.pull(project="my-app", agent="cursor")      # 2b — 70% smaller

What it does

StateSync is a middleware layer that gives every AI agent in your stack the same long-term memory. It captures each agent's checkpoints (messages, files, decisions, test results) and returns a compressed, unified brief when the next agent starts — so Cursor can pick up exactly where Claude left off, without re-sending 50k tokens.

Under the hood: real semantic embeddings (BAAI/bge-small-en-v1.5) + temporal decay + LLM summarization → 70–85% smaller context on every sync.

👉 Read the concepts guide

Quickstart

Full walkthrough: https://www.statesync.it/docs/quickstart

from agent_state import StateSync

sync = StateSync(api_key="ss_live_...")

# 1) Cursor finishes a task
sync.checkpoint(
    project="todo-app",
    agent="cursor",
    messages=[
        {"role": "user", "content": "Add JWT auth"},
        {"role": "assistant", "content": "Added auth.py with bcrypt + jwt"},
    ],
    files=["auth.py", "server.py"],
    decisions=["Use bcrypt for password hashing"],
    tests_passed=["test_login"],
)

# 2) Claude Desktop takes over an hour later
brief = sync.pull(project="todo-app", agent="claude", query="password reset")
print(brief["compressed_context"]["summary"])
print("Savings:", brief["compressed_context"]["savings_pct"], "%")

API reference

Complete reference with endpoint tables, params, and response examples:

Topic Docs link
Projects API https://www.statesync.it/docs/api-projects
Snapshots API https://www.statesync.it/docs/api-snapshots
Sync & Compress https://www.statesync.it/docs/api-sync
Analytics & Audit https://www.statesync.it/docs/api-analytics
Rate limits & pricing https://www.statesync.it/docs/guide-rate-limits

Python-SDK-specific reference: https://www.statesync.it/docs/sdk-python

Get an API key

Sign up free at https://www.statesync.it — 1,000 syncs/mo, no credit card. Create a key from Dashboard → API Keys, then export it:

export STATESYNC_API_KEY=ss_live_...

StateSync() with no args will pick it up.

MCP support

StateSync is also an MCP server. Drop this into your Cursor / Claude Desktop config:

{
  "mcpServers": {
    "statesync": {
      "url": "https://www.statesync.it/api/mcp",
      "headers": { "Authorization": "Bearer ss_live_..." }
    }
  }
}

Full MCP integration guide: https://www.statesync.it/docs/cursor Tools exposed: statesync_list_projects, statesync_create_project, statesync_checkpoint, statesync_pull. Resources: statesync://project/{id}, statesync://project/{id}/snapshots, statesync://snapshot/{id}, statesync://audit.

Links

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_state_api-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

agent_state_api-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file agent_state_api-0.1.1.tar.gz.

File metadata

  • Download URL: agent_state_api-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for agent_state_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d72a36352919a7d5755a0761228c7fe661d5507a34626a26c6a509daa22767f9
MD5 7c2a72c678677b9a351b1301c14b3ab4
BLAKE2b-256 99be847dcfc261ded1829267f914aee846a4a2a3afedc9d08c7b654f0807e287

See more details on using hashes here.

File details

Details for the file agent_state_api-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_state_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62b55dce3d36b035d7c945efbb5b7fca3d7d8858662adaf186286a8bf055c533
MD5 e094ba249d752e49b164650d43783a96
BLAKE2b-256 e376d4d674fb60830f3a09a447a15c02953e33848b566f320efa03d668b674fa

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 Sentry Error logging StatusPage Status page