Metadata-Version: 2.4
Name: stigmem-py
Version: 0.9.0a10
Summary: Python client SDK for Stigmem — the federated knowledge fabric
Author-email: Eidetic Labs <oss@eidetic-labs.ai>
License: Apache-2.0
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.7
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# stigmem-py

Python client SDK for [Stigmem](https://github.com/eidetic-labs/stigmem) — the federated knowledge fabric.

## Install

```bash
pip install stigmem-py
```

## Quick start

```python
from stigmem import StigmemClient, string_value

client = StigmemClient(url="http://localhost:8765", api_key="sk-...")
fact = client.assert_fact(
    entity="user:alice",
    relation="memory:role",
    value=string_value("CEO"),
    source="agent:cto",
    session_id="session:example",
)
page = client.query(entity="user:alice", scope="company")
```

## Session and provenance options

Agent integrations should pass a stable `session_id` on reads and writes so the
node can enforce same-session read/write graph isolation. Writes that summarize
facts read earlier in the same session should use
`write_mode="summarize_with_provenance"` and carry source facts in
`derived_from`.

```python
from stigmem import text_value

client.assert_fact(
    entity="handoff:session-123",
    relation="intent:handoff_summary",
    value=text_value("Summarized context for the next agent."),
    source="agent:openclaw",
    session_id="session:example",
    write_mode="summarize_with_provenance",
    derived_from=[{"fact_id": "fact-source-001"}],
)
```

## License

Apache-2.0
