Skip to main content

Python client for Memnode, persistent memory for AI agents

Project description

memnode (Python)

Python client for Memnode, persistent memory for AI agents.

  • Stdlib-only — no runtime dependencies (uses urllib, json).
  • Wraps the v1 endpoints exposed by the Rust data plane.
  • Typed response dataclasses.

Quickstart and proof

If you land on this package page first, use this order:

  1. Install + proof loop: https://memnode.dev/mcp
  2. Public demo article: https://memnode.dev/articles/claude-code-memory-demo
  3. Downloadable 14-second proof loop: https://memnode.dev/article-images/mcp-demo-loop.mp4
  4. Hosted docs: https://memnode.dev/docs

The shortest believable Memnode loop is still MCP-first:

  • teach Claude Code one repo convention
  • start a fresh task or later session
  • recall it and inspect lineage

Install

Published package:

pip install memnode

Local development:

cd clients/python
pip install -e .

Usage

from memnode import MemnodeClient

client = MemnodeClient("https://api.memnode.dev", "mn_live_...")

result = client.recall("Where is the user moving?")
print(result.answer, result.confidence)
for hit in result.supporting_memories:
    print(hit.node_id, hit.props.get("summary"), hit.score)

query = client.query(
    "Observation",
    filter={
        "_memory_status": {"$in": ["supported", "canonical"]},
        "_support_count": {"$gte": 3},
    },
    limit=10,
)
print(query.nodes[0].props.get("summary"))

client.feedback(memory_id=result.supporting_memories[0].node_id, helpful=True)

health = client.healthz()
print(health.ok)

Compatibility import still works:

from memnode_client import MemnodeClient

For the shortest proof loop, start with the local MCP path first and keep this package for hosted or app-backend use.

Endpoints

Method HTTP Notes
recall POST /v1/recall Returns typed RecallResponse
feedback POST /v1/feedback Mark a supporting memory helpful / not helpful
explain POST /v1/explain Raw JSON with per-edge scoring
query POST /v1/query Structured query for memory inspection
record_procedure POST /v1/procedures Persist a trigger → action-sequence procedure
recall_procedures GET /v1/procedures Retrieve procedures, optionally by trigger
memory_lineage GET /v1/lineage/{id} CORRECTS / SUPERSEDES / DERIVED_FROM chain
healthz GET /healthz Liveness probe
status GET /v1/status Control-plane lease + data-plane counters

Recording raw observations over HTTP is not yet supported server-side. Until POST /v1/record ships, use the MCP transport to record memories.

Errors

All errors inherit from MemnodeError:

  • MemnodeAuthError — 401/403
  • MemnodeRateLimitError — 429, carries retry_after seconds when the server returns a Retry-After header
  • MemnodeUnavailableError — 503 (control-plane lease gone, data plane shutting down, etc.)
  • MemnodeHTTPError — other non-2xx responses, carries status and body

Tests

PYTHONPATH=clients/python python -m unittest discover clients/python/tests

Tests spin up an in-process http.server on a random port and drive the client end-to-end — no mocks, no fixtures.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memnode-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memnode-0.1.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file memnode-0.1.0.tar.gz.

File metadata

  • Download URL: memnode-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for memnode-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8551238eaff5c2dc421e6aa2b368054afaefa2a2551c2d34e15da3b5a6f6ddd7
MD5 a39202a1e3da91e1669b1fb52dd0aadf
BLAKE2b-256 20596070a0814e6d4bf0ec8096e767891d456e234be7d79c18f48e2bae09c3dc

See more details on using hashes here.

File details

Details for the file memnode-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memnode-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for memnode-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e90fe68ee6ec12f8b143fe9b76f6f0d9bdd71cc28225e8f8b1598ff462e64ab1
MD5 6f0054eccd8218f920e588cff399e02f
BLAKE2b-256 5813d0eabe0e6443616d556242d039b26179de91d2e5fba8c1710cf556132109

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page