Official Python client for MemClaw — governed shared memory for AI agent fleets (multi-agent, multi-tenant, MCP-native).
Project description
memclaw-client
Official Python client for MemClaw — governed shared memory for AI agent fleets (multi-agent, multi-tenant, MCP-native).
A thin wrapper over the MemClaw REST API. Point it at a managed
(https://memclaw.net) or self-hosted (http://localhost:8000) deployment.
Install
pip install memclaw-client
Quickstart
from memclaw_client import MemClaw
mc = MemClaw("mc_xxx", tenant_id="my-team", agent_id="my-agent")
# Write a memory — enriched server-side with type, title, tags, importance.
mc.write("Q3 revenue target is $4M, set on 2026-04-15.")
# Search (ranked raw results)
for m in mc.search("Q3 revenue target", top_k=5):
print(m.title, "—", m.content)
# Recall (LLM-synthesized context brief)
print(mc.recall("Q3 revenue target").summary)
Self-hosted? Pass base_url:
mc = MemClaw("standalone", tenant_id="default", base_url="http://localhost:8000")
API
| Method | Endpoint | Returns |
|---|---|---|
write(content, ...) |
POST /api/v1/memories |
Memory |
search(query, top_k=5, ...) |
POST /api/v1/search |
list[Memory] |
recall(query, top_k=5, ...) |
POST /api/v1/recall |
RecallResult |
health() |
GET /api/v1/health |
dict |
The client is a context manager (with MemClaw(...) as mc:) and raises
AuthError (401/403), NotFoundError (404), or MemClawAPIError on failures.
Every result also exposes the full API payload on .raw.
For credentials, scopes, and the full API surface, see the MemClaw docs. Production fleets should use per-agent keys.
memclaw-interviewer — Claude Code adapter (Interviewer Phase 2)
Installing this package also provides the memclaw-interviewer CLI: the
MemClaw Interviewer's disk-parser adapter for Claude Code workstations. It
reads Claude Code session transcripts (~/.claude/projects/…/*.jsonl)
read-only, tracks a per-file cursor via the server's forward-only
watermark documents (no local state), and submits event windows to
POST /api/v1/interview/submit, where MemClaw synthesizes them into typed
memories. Requires the tenant to have interviewer.enabled = true.
export MEMCLAW_API_KEY=mc_xxx MEMCLAW_TENANT_ID=my-team
export MEMCLAW_INTERVIEWER_PROJECTS="-Users-me-work-*" # allowlist, default-deny
memclaw-interviewer status --since-hours 24 # cursors vs. local line counts
memclaw-interviewer run --dry-run -v # parse + window, submit nothing
memclaw-interviewer run --max-windows 8 # submit due windows
Privacy: default-deny — with no allowlist the CLI lists discovered
project dirs and exits with guidance; --all-projects is the explicit
opt-in. Credential-shaped strings are scrubbed locally before anything
leaves the machine, and the server masks PII again on receipt.
Triggers: run it from cron, or wire Claude Code's SessionEnd hook so a session is interviewed the moment it ends (a failed harvest never fails the session — the hook always exits 0):
{ "hooks": { "SessionEnd": [ { "hooks": [
{ "type": "command", "command": "memclaw-interviewer hook", "timeout": 300 }
] } ] } }
Crash-safety is inherited from the Interviewer protocol: the watermark advances only after the server commits a window, and retries of the same window dedup server-side via a deterministic attempt id — never a gap, never a duplicate.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memclaw_client-0.2.0.tar.gz.
File metadata
- Download URL: memclaw_client-0.2.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96b4b79be90482c5ae318b696afaff0db09353cdc4ad3e102913732330089c4d
|
|
| MD5 |
4a9ed0fa305e89db43e6eb755ee578ae
|
|
| BLAKE2b-256 |
ab8d73cb09c74adb4be43ac0907d12015c41d9a3d6949c95e0e1ac451cac706c
|
Provenance
The following attestation bundles were made for memclaw_client-0.2.0.tar.gz:
Publisher:
publish-python-client.yml on caura-ai/caura-memclaw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memclaw_client-0.2.0.tar.gz -
Subject digest:
96b4b79be90482c5ae318b696afaff0db09353cdc4ad3e102913732330089c4d - Sigstore transparency entry: 2212168405
- Sigstore integration time:
-
Permalink:
caura-ai/caura-memclaw@bef753ccbd9f2071f52e5fd0af9613c10f54a5ca -
Branch / Tag:
refs/tags/memclaw-client-v0.2.0 - Owner: https://github.com/caura-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-client.yml@bef753ccbd9f2071f52e5fd0af9613c10f54a5ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file memclaw_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: memclaw_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9275be483b64b7f4c991b95271befa67238d585448837cdab7252fb688f5a23b
|
|
| MD5 |
d6cfd888e0db0c385a9255fddc75172d
|
|
| BLAKE2b-256 |
0d3c712c7d7fcc8eb6253e133e1db8fc29477b2f331b1f20e5bd0b06d0e5a9d1
|
Provenance
The following attestation bundles were made for memclaw_client-0.2.0-py3-none-any.whl:
Publisher:
publish-python-client.yml on caura-ai/caura-memclaw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memclaw_client-0.2.0-py3-none-any.whl -
Subject digest:
9275be483b64b7f4c991b95271befa67238d585448837cdab7252fb688f5a23b - Sigstore transparency entry: 2212168423
- Sigstore integration time:
-
Permalink:
caura-ai/caura-memclaw@bef753ccbd9f2071f52e5fd0af9613c10f54a5ca -
Branch / Tag:
refs/tags/memclaw-client-v0.2.0 - Owner: https://github.com/caura-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-client.yml@bef753ccbd9f2071f52e5fd0af9613c10f54a5ca -
Trigger Event:
push
-
Statement type: