Skip to main content

daimon — Python SDK

Thin Python client over the Daimon daemon's Unix-socket JSON-RPC surface (SPEC §6.1). Mirrors the Go cmd/daimon CLI's wire-level behaviour: one connection per RPC, no pipelining, JSON-RPC 2.0.

Status: v0.1.0 — first GA release. Identity, memory, provider (list / invoke / stream), and activity verbs all surfaced.

Install

From PyPI:

pip install daimon-protocol

From a checkout of the Daimon repo:

pip install -e sdk/python

The PyPI distribution name is daimon-protocol because the unqualified daimon name on PyPI is held by an unrelated dormant package, and daimon-sdk / daimon-client belong to other active projects. The import name remains daimon — from daimon import Client works regardless of how you installed it.

Use

The SDK assumes a running daimon daemon on the local machine, reachable via the same socket path the Go CLI uses ($DAIMON_HOME/daimon.sock, with the same long-path fallback rules). Start the daemon first:

daimon unlock

Then:

from daimon import Client

client = Client()                                  # resolves $DAIMON_HOME
print(client.identity.get())                       # {"did": "did:key:..."}

# memory.Kind.Valid() accepts: "fact", "preference", "task", "observation"
mid = client.memory.write(kind="fact", content="the sky is blue")
print(mid)                                         # {"id": "01K..."}

mem = client.memory.read(mid["id"])
hits = client.memory.search("sky")                 # [{...mem, "score": 0.7}, ...]
all_mems = client.memory.list()                    # search with empty query

# provider verbs
providers = client.provider.list()
env = client.provider.invoke(
    provider="ollama",
    model="llama3.2:latest",
    messages=[{"role": "user", "content": "hi"}],
)
print(env["response"]["content"])

# streaming — yields delta strings; final envelope on .final
stream = client.provider.stream(
    provider="ollama",
    model="llama3.2:latest",
    messages=[{"role": "user", "content": "count to 3"}],
)
for delta in stream:
    print(delta, end="", flush=True)
print()
print("usage:", stream.final["response"]["usage"])

# activity verbs (audit trail)
client.activity.append(kind="custom.event", payload={"n": 1})
entries = client.activity.query(limit=20)
result = client.activity.verify()                  # {"verified": N, "ok": True}

Errors

from daimon import DaemonNotRunning, DaemonLocked, RPCError

try:
    client.memory.write(kind="fact", content="x")
except DaemonNotRunning:
    # daimon binary isn't serving on this $DAIMON_HOME
    ...
except DaemonLocked:
    # daemon is running but `daimon unlock` hasn't been called
    ...
except RPCError as e:
    # any other JSON-RPC error from the daemon
    print(e.code, e.message, e.data)

Development

cd sdk/python
pip install -e .[dev]
pytest

The test suite uses a stub Unix-socket daemon (no real keys, no real storage) plus optional smoke tests against a live daimon when one is running.

See also

  • TypeScript SDK — sister SDK, same wire shape, async-iterator streaming surface.
  • examples/streaming — cross-language streaming reference: both SDKs round-trip token deltas through one daemon, audit chain verified three ways.
  • CHANGELOG.md — release notes per version.

Metadata

Release files for daimon-protocol 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for daimon-protocol 0.1.0
File Size Uploaded Provenance Actions
daimon_protocol-0.1.0.tar.gz 24.5 kB Without provenance Details for daimon_protocol-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for daimon-protocol 0.1.0
File Interpreter ABI Platform Actions
daimon_protocol-0.1.0-py3-none-any.whl Python 3 none any Details for daimon_protocol-0.1.0-py3-none-any.whl

Total release size: 43.9 kB

Release files / daimon_protocol-0.1.0.tar.gz

Download URL daimon_protocol-0.1.0.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8faca0f94dd4eae7153896bd5cecfc93ebfa78266a0a7b43ba8bb64293ec9570
BLAKE2b-256 checksum
How to use checksums
1223c53885a30593df833ea86d716df8f6ea38428d9e0cd83a3465c7a25e0710
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release files / daimon_protocol-0.1.0-py3-none-any.whl

Download URL daimon_protocol-0.1.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbeab3eb336f0b72f165ac327b4278abc8f1f85c22ba1876ab7bc6c8122a9e17
BLAKE2b-256 checksum
How to use checksums
82ea66902fc13158845b6b7c88937de96541d28d3be63228c123af56c30d5bff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Security for daimon-protocol 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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