Skip to main content

cryptomem

Cryptographically verified, relational, persistent memory for AI agents.

This package is the Python engine. Every fact is SHA-256 hashed and Ed25519 signed at write time; at read time each node is re-verified, and tampered or unsigned facts are dropped so the agent abstains rather than guessing.

Install

pip install cryptomem                  # core engine
pip install "cryptomem[serve,local]"   # + Ollama-compatible sidecar & local embeddings

Published on PyPI; the typed Rust client is cryptomem-rs on crates.io.

from cryptomem import MemoryClient

mem = MemoryClient()
mem.archive("Project Phoenix", "Budget approved at $4.2M for FY26.")

for hit in mem.query("What budget did Project Phoenix get?"):
    print(hit.node.content, hit.confidence)

print(mem.answer("What budget did Project Phoenix get?"))

Runs on CPU-only hardware with zero model downloads via the default stub embedder and in-memory SQLite store. See the repository docs/ for the full architecture and roadmap.

Beyond retrieval

  • mem.respond(...) — answer plus a provenance block (injected node ids, verification status, Merkle root).
  • mem.proof(node_id) — a verifiable Merkle inclusion proof against the current ledger root.
  • mem.confidence(...) — semantic-entropy confidence over sampled answers.
  • mem.verify_answer(draft) — Chain-of-Verification re-check of a draft.
  • mem.contradictions() — same-entity nodes whose content diverges.
  • mem.suggest(...), mem.triggers(), mem.stage_facts(...), mem.pending(), mem.confirm(node_id) — proactive planner, triggers, and write-back of staged (pending) facts that you later confirm.

Store backends

Selected via CRYPTOMEM_MODE (or Settings(mode=...)):

  • sqlite (default) — zero-config local store; Python-side vector search.
  • neo4j — graph-native store over the Bolt driver (pip install "cryptomem[neo4j]", CRYPTOMEM_NEO4J_URI=...).
  • remote — signs locally and POSTs verbatim to a /cmem/v1/* backend (CRYPTOMEM_BACKEND_URL=...); falls back to SQLite if the backend is down.

Use with agno

Expose verified memory as agno tools so the agent answers only from signed facts (or abstains):

from agno.agent import Agent
from agno.models.ollama import Ollama
from cryptomem import MemoryClient

MEM = MemoryClient()

def recall_verified_memory(query: str) -> str:
    """Return only signature-verified facts; abstain if none match."""
    hits = [h for h in MEM.query(query, top_k=5) if h.verified]
    if not hits:
        return "NO_VERIFIED_MEMORY: abstain; do not guess."
    return "\n".join(f"- [{h.node.node_id}] {h.node.content}" for h in hits)

agent = Agent(model=Ollama(id="qwen2.5:0.5b"), tools=[recall_verified_memory])
agent.print_response("What budget did Project Phoenix get?")

Full runnable example: examples/agno_verified_memory.py. See also ../docs/framework_integrations.md.

Optional extras

pip install "cryptomem[local]" (MiniLM embeddings), [serve] (FastAPI Ollama-compatible sidecar + CLI), [neo4j] (graph store), [agno] (agno integration example), [dev] (tooling).

Metadata

Release files for cryptomem 0.1.14

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

Source distribution (sdist)

Source distribution for cryptomem 0.1.14
File Size Uploaded Provenance Actions
cryptomem-0.1.14.tar.gz 64.0 kB Without provenance Details for cryptomem-0.1.14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cryptomem 0.1.14
File Interpreter ABI Platform Actions
cryptomem-0.1.14-py3-none-any.whl Python 3 none any Details for cryptomem-0.1.14-py3-none-any.whl

Total release size: 104.1 kB

Release files / cryptomem-0.1.14.tar.gz

Download URL cryptomem-0.1.14.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
276b4351aaab20ce8ec96a309a2aacf18ffbee452ee6b54b6b904972c03d3ad3
BLAKE2b-256 checksum
How to use checksums
9295fea5435b1639b3f0d4ddb278f0dd3f6458dc5316124aca1263485e6e39b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / cryptomem-0.1.14-py3-none-any.whl

Download URL cryptomem-0.1.14-py3-none-any.whl
Size 40.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17b6a9e7d948aa6250962279d4213cc08f14f72636d030ea072a68515c0fc461
BLAKE2b-256 checksum
How to use checksums
6cbca8d7cff61cfff2fe0e94b828f3f472c73dde307572d416b3ae10ed17af9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for cryptomem 0.1.14

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