{
  "markdown": "# GRAFOMEM\n\n**The governed memory runtime for agents.** Signed checkpoints, provable erasure, portable memory — a drop-in wrapper for your LangGraph checkpointer.\n\n[![PyPI](https://img.shields.io/pypi/v/grafomem)](https://pypi.org/project/grafomem/)\n[![License: MIT](https://img.shields.io/pypi/l/grafomem)](LICENSE)\n[![CI](https://github.com/GNS-Foundation/grafomem/actions/workflows/ci.yml/badge.svg)](https://github.com/GNS-Foundation/grafomem/actions/workflows/ci.yml)\n[![Python](https://img.shields.io/pypi/pyversions/grafomem)](https://pypi.org/project/grafomem/)\n\n```bash\npip install grafomem langgraph-checkpoint-grafomem langgraph\n```\n\n```python\nfrom typing import TypedDict\nfrom cryptography.hazmat.primitives.asymmetric import ed25519\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.checkpoint.memory import MemorySaver\nfrom grafomem_checkpoint import GrafomemSerializer, GrafomemCheckpointSaver\n\n# ── the entire GRAFOMEM integration: an Ed25519 signing key, then wrap ANY\n#    LangGraph checkpointer. Pass it to compile() as you already do. ──\npriv = ed25519.Ed25519PrivateKey.generate()\nsaver = GrafomemCheckpointSaver(MemorySaver(serde=GrafomemSerializer(private_key=priv)))\n\n# ── your ordinary LangGraph agent ──\nclass State(TypedDict):\n    messages: list\n\ndef agent(state: State) -> State:\n    return {\"messages\": state[\"messages\"] + [\"hello from the agent\"]}\n\nb = StateGraph(State); b.add_node(\"agent\", agent)\nb.add_edge(START, \"agent\"); b.add_edge(\"agent\", END)\napp = b.compile(checkpointer=saver)\n\ncfg = {\"configurable\": {\"thread_id\": \"user-42\"}}\napp.invoke({\"messages\": []}, cfg)\n\n# signed, content-addressed checkpoint\ntup = saver.get_tuple(cfg)\nprint(\"signed checkpoint hash:\", tup.metadata[\"grafomem_content_hash\"])\n\n# cryptographic erasure receipt — proof the erasure transition occurred\nsaver.delete_thread(\"user-42\")\nprint(\"erasure receipt:\", saver.last_receipt(\"user-42\"))\n```\n\n```text\nsigned checkpoint hash: ecd0e28938738cc55b3c888f7449503fd586723a699e1d326d74cc0f154874f7\nerasure receipt: LangGraphErasureReceipt(pre_state_hash='d9a16ef8…', post_state_hash='0e5751c0…',\n                 scope='user-42', key_id='grafomem_checkpoint', timestamp='2026-…', signature=b'…')\n```\n*(hashes and signature vary per run — each run generates a fresh key)*\n\n**What just happened:** every state transition your agent made was captured as a signed, content-addressed checkpoint — and when you deleted, you got a cryptographic receipt proving the erasure transition occurred. Memory your agents can move, merge, and prove they erased.\n\n## Why\n\nAgent memory today is a JSON blob you have to trust. GRAFOMEM makes it evidence: every write signed, every fact content-addressed, every deletion receipted. When someone asks *\"what did your agent know, and when?\"* — you answer with proofs, not logs.\n\n## Two tiers, one system\n\n- **Working memory** — fast, bounded context state for the agent loop.\n- **Durable facts (GMP)** — governed, bi-temporal, signed facts with provenance. The GRAFOMEM Memory Protocol is an open spec with an executable conformance suite: a backend's capability counts as *supported* when it passes the test, not when the vendor says so.\n\n→ [Architecture overview](https://docs.grafomem.com/architecture/overview)\n\n## Integrations\n\n- **LangGraph** — the quickstart above. → [docs](https://docs.grafomem.com/integrations/langchain)\n- **Claude / MCP** — expose governed memory as MCP tools. → [docs](https://docs.grafomem.com/integrations/claude-mcp)\n- **Reference server** — a REST + MCP server (`grafomem[server]` extra); a hosted instance runs live at [api.grafomem.com](https://api.grafomem.com/healthz). → [self-hosting docs](https://docs.grafomem.com/server/self-hosting)\n\n## The bigger picture: verify the agent, not just the answer\n\nGoverned memory is the evidence substrate for something larger: **Capability-Grounded Reputation (CGR)** — reputation an agent earns per domain from judgments that later resolve against real outcomes, with peer reviews weighted by the reviewer's own demonstrated calibration. Score and evidence mass travel together; fresh identities don't arrive with influence. The scoring model is documented and independently reproducible — [cgr-bench](https://github.com/GNS-Foundation/cgr-bench) reproduces its properties from source: cold-start and Sybil-resistance behavior asserted in CI, an early-warning signal of −0.997 against real credit-default outcomes at 25% resolution, and reviewer calibration that beats a naive equal-weight crowd by ~14% out-of-sample on ~1,900 real human forecasters (held-out reliability recovery r ≈ 0.5–0.65 across split designs). Reputation as evidence, not assertion. → [CGR overview](https://docs.grafomem.com/cgr/overview)\n\n## License\n\nRuntime: **MIT**. The GMP spec is open. → [LICENSE](LICENSE)\n\n---\n\nDocs: [docs.grafomem.com](https://docs.grafomem.com) · Hosted: [cloud.grafomem.com](https://cloud.grafomem.com) (free tier: 10,000 governed decisions / mo) · Issues & discussions welcome.\n",
  "bytes": 5010,
  "sha": "cdcb967d09a7e492e935d92fca02c38511c8d30fcd23675ac929d3c06fcbbf5a",
  "repo_slug": "gns-foundation/grafomem",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_grafomem_cgr_capture_611a61be/readme"
}