Skip to main content

aleth-client

A thin, standalone Python client for Aleth's persistent memory + thesis tracking over the warm-daemon wire. Part of MEM-SDK (ROADMAP ch.161, Option A). It imports no engine package and depends only on pydantic -- a sibling project (a Hand, another venture's agent) can pip install it and get durable memory without pulling in the Brain.

License (S1421): MIT. The client and the MPB-2 host plugins (clients/aleth-hermes, clients/aleth-openclaw) are open-source; the Aleth engine (the daemon this client talks to) stays closed.

Install

pip install ./clients/aleth-client

(In-repo install only -- no PyPI publish, by design. Copy the directory into a sibling project and pip install ./aleth-client there.)

Prerequisite: a running engine

The client talks to a running engine discovered via its .aleth_daemon.json discovery file (under data/runtime/ by default, or pass discovery_dir= / set ALETH_DISCOVERY_DIR). The daemon holds the warm graph; the client stays thin and never loads a local copy.

# the host that serves this wire in-repo (it writes .aleth_daemon.json):
python -m enki.runtime --pool-id baseline-pool --is-master --data-dir data --detach

Usage

from aleth_client import MemoryClient

mem = MemoryClient().connect()          # verifies reachability + protocol MAJOR

node = mem.remember("The sky is blue", origin="user")
print(node.node_id, node.classification)   # a computed judgment, not a constant

# Declare what you know about your own memory; your word outranks analysis.
fact = mem.remember("My locker code is 4312", classification="fact")

hits = mem.recall("sky", limit=5)
for n in hits.nodes:
    print(n.node_id, round(n.score, 3), n.content[:60])

# Thesis tracking
mem.store_reasoning_chain(
    chain_id="my_decision", title="My decision",
    steps=["weighed A [0.8]", "B cheaper [0.9]"], session_number=1,
)
h = mem.create_hypothesis(
    prediction="X holds", rationale="...", falsification_condition="...",
    confidence=0.6, hypothesis_type="completion", testability=0.8,
    testable_criteria="...", source_node_ids=[],
)
mem.add_hypothesis_evidence(
    hypothesis_id=h.node_id, outcome="confirmed",
    evidence_node_ids=[], confidence_change=0.1, experiment_id="exp1",
)

Method surface

Memory: remember, recall, recall_deep, recall_ranked, show, search, retract, connect_nodes, status, nodes. Thesis: store_intuition, store_reasoning_chain, session_checkpoint, recall_chains, recall_intuitions, create_hypothesis, add_hypothesis_evidence, retract_hypothesis. Goals: goal_create, goals_list, goal_detail, goal_progress, goal_achieve, goal_abandon. Governance: bios_check, bios_status. (No forget -- the memory surface is retract-based, matching the wire.)

Errors

DaemonUnavailable (no daemon answered), BackendError (daemon-side failure, incl. an [UNCERTAIN] write whose confirmation never arrived -- verify before retrying), NodeNotFound, BIOSDenied (blocked by a BIOS axiom), ProtocolMismatch (the daemon advertises a different contract MAJOR).

Versioning & compatibility

The wire contract is frozen at MEMSDK_PROTOCOL_VERSION = "2.3" and governed by semver (MAJOR = breaking, MINOR = additive, PATCH = fix). v2.3 (RV2-2, S1567) adds VALID TIME: the optional observed_at / valid_from / valid_to kwargs on remember and as_of on recall, plus valid_at and the three dates on each returned row, as_of / order on the result, and the three dates on show. A superseded belief becomes reachable BY DATE instead of only by being the newest. v2.2 (S1566) adds match_strength per row and the coverage verdict. v2.1 (EPI-1, S1565) adds the optional classification / confidence declaration kwargs on remember -- forwarded only when given, so older servers never see them. (This line read "2.1" while the constant was already "2.2"; corrected S1567 -- the number here is a CLAIM and must move with version.py.) v1.1 (MPB-2, S1421) adds recall_ranked -- daemon-side cross-encoder-ranked recall (bge-reranker-v2-m3 on CUDA hosts / ms-marco-MiniLM-L-12-v2 on CPU) whose nodes carry created_at for the dated presentation helper (aleth_client.presentation.dated_block). The daemon advertises its version via sdk_status; connect() checks the MAJOR matches and raises ProtocolMismatch otherwise. The full spec is docs/architecture/deployment/mem-sdk-contract.md; drift between this copy and the engine is caught by the conformance guard (tests/test_contract_conformance.py, MSDK-3).

Trust model (read this -- MSDK-5)

This client authenticates to the daemon with a local discovery-file token and inherits the same-box trust boundary: everything on the box is the operator. It does NOT provide per-consumer identity, tenancy isolation, or off-box transport, and a plain recall sees the GLOBAL memory graph (the source_project tag is a filter, not a partition). Do not expose this client across a trust boundary or treat it as an externally-safe, multi-tenant API. Anyone needing authenticated per-consumer identity, real tenancy, or an off-box endpoint wants the (un-built, rejected-for-now) Option B in docs/ROADMAP_ALT.md.

Which surface do I want?

  • This client (aleth-client) -- you are writing Python code in a sibling project that needs durable memory over the wire.
  • The foreign-MCP-window path -- you are an assistant window (Claude Code / VS Code) working inside another venture's repo and want the memory graph as MCP tools with project provenance. See docs/reference/using-enki-from-other-projects.md.

Release files for aleth-client 1.4.1

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

Source distribution (sdist)

Source distribution for aleth-client 1.4.1
File Size Uploaded
aleth_client-1.4.1.tar.gz 39.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aleth-client 1.4.1
File Interpreter ABI Platform
aleth_client-1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.3 kB

Release files / aleth_client-1.4.1.tar.gz

Download URL aleth_client-1.4.1.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84cc820e5c9cecbc08014092e3bc21359ed8a0370ede762f0790c6230a3bf183
BLAKE2b-256 checksum
How to use checksums
d6b1d40f64b7b898b4fda520c7000d32724e324b18a13fea03b58869ddea44a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / aleth_client-1.4.1-py3-none-any.whl

Download URL aleth_client-1.4.1-py3-none-any.whl
Size 30.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d30d35b59d56f6a700b0f0dfbf72c15f08d2234e18979bf717e539a8f8dd8ce0
BLAKE2b-256 checksum
How to use checksums
cd8780863848b41191ff89d6861639d0df0db148af57919b67b31ddccf7916f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.4.1 This release

2 release files

1.4.0

2 release files

1.3.0

1 release file

0.0.0

1 release file

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