Skip to main content

Governed local memory with Python SDK, MCP server, API, CLI, and console

Project description

MemoryNode Python SDK

Synchronous typed access to the existing MemoryNode FastAPI service, plus stdio and local shared Streamable HTTP MCP. The SDK and MCP process never access SQLite or start the API.

from memorynode import MemoryNodeClient

with MemoryNodeClient("http://127.0.0.1:8000", timeout=10) as client:
    assert client.status.check().ok
    result = client.proposals.extract(
        actor_id="demo-user",
        project_id="memorynode-demo",
        content="以后回答使用中文",
    )
    memories = client.memories.search("语言偏好")

Resources:

  • status.check()
  • sources.get()
  • proposals.create/extract/list/get/related_memories/approve/reject()
  • events.get/list_recent()
  • memories.search/list/get/explain/revoke/feedback/set_expiry()

Every method accepts timeout= and request_id=. The SDK sends a generated X-Request-ID by default and retains it in errors for client-side correlation; the current server does not provide end-to-end request tracing. Unknown response fields are accepted, while missing or invalid required fields raise MemoryNodeResponseError. Server failures and suspicious details are redacted.

Phase 1 compatibility methods health(), extract_proposals(), search_memories(), and explain_memory() still return JSON-compatible dicts. The MCP entry point remains memorynode-mcp (or python -m memorynode). Default discovery exposes memory_propose, memory_search, memory_get, memory_explain, memory_list, and memory_feedback. Governance tools are hidden unless true TOML booleans in local config.toml enable them.

The memorynode CLI provides init, start, stop, restart, status, doctor, mcp, data commands, and version. The 0.7.1 wheel includes the FastAPI backend and static governance console:

memorynode init
memorynode start
memorynode status
memorynode stop

No source checkout or Node.js runtime is required. API and console default to 127.0.0.1:8000 and 127.0.0.1:3000; their distinct ports are configurable by CLI, environment, or TOML. The console receives only the API origin from its runtime config endpoint, and CORS allows only the configured console origin.

Development:

py -3.13 -m pip install -e ".[test]"
python -m pytest -q
python ../../scripts/build_release.py

Related memories remain reviewer-facing candidates, not automatic conflict decisions. Expiration remains request-driven.

memorynode mcp remains the stdio default. For a shared local endpoint, first run memorynode init and store the bearer token printed once, then run:

memorynode start
memorynode mcp --transport http --host 127.0.0.1 --port 8765

Connect MCP clients to http://127.0.0.1:8765/mcp using Authorization: Bearer <token>. HTTP accepts only 127.0.0.1; it rejects a missing or invalid token before MCP handling. Existing configurations can create a replacement token with --print-token-once. Only a token hash is persisted, and mcp.log records sanitized connection/call metadata, never tokens, headers, content, queries, parameters, or responses. The static console does not yet include an MCP overview because it cannot safely read local log files.

For install/uninstall, data handling, backup/restore/import/export, governance, and troubleshooting guidance, see the repository README, SECURITY.md, and TROUBLESHOOTING.md.

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

memorynode-0.7.1.tar.gz (300.7 kB view details)

Uploaded Source

Built Distribution

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

memorynode-0.7.1-py3-none-any.whl (332.5 kB view details)

Uploaded Python 3

File details

Details for the file memorynode-0.7.1.tar.gz.

File metadata

  • Download URL: memorynode-0.7.1.tar.gz
  • Upload date:
  • Size: 300.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memorynode-0.7.1.tar.gz
Algorithm Hash digest
SHA256 16738ec30a1770ed9c802d06caa2664657d8e63a427fa74a68d3e7e9ea3d1985
MD5 7a44c01f6c21c135bafa4714338de963
BLAKE2b-256 a16be87228629c88b225933991fc588c82f27d4058495fe2c99d371032c7ee7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for memorynode-0.7.1.tar.gz:

Publisher: sdk-release.yml on unnoderes/MemoryNode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memorynode-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: memorynode-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 332.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memorynode-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d78804b825e9a11a2faae5a1ed545c88de74fbf7bcb5b447ccac887536f650c5
MD5 a63f73696dc0796e720b81d32aa8b06d
BLAKE2b-256 b3781e06f29af9bbba75973400708087089ff99d1b1e7faf4d91a52c863208e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for memorynode-0.7.1-py3-none-any.whl:

Publisher: sdk-release.yml on unnoderes/MemoryNode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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