Metadata-Version: 2.4
Name: contextstore-sdk
Version: 0.1.0
Summary: Client SDK for the ContextStore company brain — compiled memory and agent team, accessed via a typed Python API.
Author: ContextStore
License: MIT
Project-URL: Homepage, https://contextstore.oritm.tech
Keywords: memory,mcp,second-brain,agents,knowledge-base
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# 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

```bash
pip install contextstore-sdk
```

## Quickstart

```python
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):

```python
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:

```python
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` |

## 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.
