Skip to main content

ContextStore Python SDK

Talk to your ContextStore company brain — compiled memory + agent team — from Python. The SDK is a typed client over your backend's MCP JSON-RPC layer.

Install

pip install contextstore-sdk

Quickstart

import os
from contextstore import ContextStore

client = ContextStore(api_key=os.environ["CONTEXTSTORE_KEY"])

# Remember something
client.memory.add(
    content="Board approved usage-based pricing on Sep 12",
    metadata={"project": "pricing", "owner": "maya"},
)

# Ask the company brain — with sources
res = client.memory.query("What did we decide about pricing?")
print(res.answer)
print(res.sources)

Local / self-hosted

Point at your own backend (default is the hosted one):

client = ContextStore(
    api_key=os.environ["CONTEXTSTORE_KEY"],
    base_url="https://contextstore.onrender.com",
)

For local development you can pass a JWT instead of an api_key:

client = ContextStore(token="<jwt>")

Namespaces / methods

Python Backend MCP tool
client.memory.add(...) memory_store
client.memory.query(...) memory_recall
client.memory.log_turn(...) log_conversation_turn
client.context.snapshot() get_context_snapshot
client.context.checkin(...) smart_checkin
client.company.learn(...) company_learn
client.company.map() / .set_map(...) company_map
client.company.review(run=True) company_review
client.company.approve(...) / .reject(...) review_propagation
client.company.pending(...) list_propagation_queue
client.permissions.grant/revoke/list(...) permission admin tools
client.permissions.check_authority(...) check_action_authority

Scopes & API keys

Each API key carries a set of scopes that limit which tools it may call. Pick the smallest set your app needs:

Scope Allows
memory:rw Store, query, and manage memories and sessions
context:read Read snapshots, session context, and local/Notion context
company:read Read the company map, learnings, org info, and the review queue
company:write Learn corrections, publish map/playbooks, approve propagation
admin Everything above, plus permission management and revocation

Required scope per namespace:

Namespace Methods Scope
client.memory.* add, query, log_turn, supersede memory:rw
client.context.* snapshot, checkin context:read
client.company.map() read map / playbooks company:read
client.company.map(set_map=...) publish map company:write
client.company.learn / approve / reject company:write
client.company.review / pending company:read
client.permissions.* grant, revoke, list, check_authority admin

A key with admin scope satisfies every tool. Requests authenticated with a user JWT (instead of an API key) are not scope-limited.

Errors

  • AuthenticationError — bad/expired/scoped-out API key
  • ApiError — the MCP tool returned an error
  • ContextStoreError — network / transport issues

No external dependencies — uses only the Python standard library.

Download files

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

Source Distribution

contextstore_sdk-0.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

contextstore_sdk-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: contextstore_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for contextstore_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c4479dc88debdfcc38618e7ce875efb1c3f6a75a0fe741f3e2303645d9a9145
MD5 e1dac59f5db45a212ee927f368f9d3c0
BLAKE2b-256 21dcd0ed912281708b8a76b3f449c27183c5ff3f5a7384ada694a30e24b27f8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for contextstore_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 effa26d3ffcc4359837395ec77b91c052d42d892dd2644b13569b6d12d3dcff8
MD5 745cd8fe58167fa2e91c14c7249c735f
BLAKE2b-256 6535f4e1f18b394a02890232f4a49ffed3d068f318cbdfb5afcb4e592cf3f15c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page