Skip to main content

Track, attribute, and gate every agent memory

memledger is the open-source trust layer for multi-agent AI — provenance chains, weakest-link confidence, and the Memory Attribution Integrity (MAI) rubric that runs in any eval framework. Open-source by default, no lock-in. Drops onto AWS managed backends when you need them.

memledger ~ pip
# OSS — Postgres + pgvector + local embeddings
$ pip install memledger[oss]
# AWS — Aurora PostgreSQL + Bedrock LLMs for embeddings and LLM-as-judge
$ pip install memledger[aws]
5 backends3 evaluator tiers1024-dim embeddingsApache 2.0
memledger ~ demo
# Install the OSS extra (Postgres + pgvector + local embeddings)
$ pip install memledger[oss]
# Start a local pgvector
$ docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=ml ankane/pgvector
$ python
>>> import asyncio
>>> from memledger import Memledger
>>> ml = await Memledger.create(
... connection_string="postgresql://postgres:ml@localhost:5432/postgres",
... confidence_policy={"min_threshold": 0.5, "flag_threshold": 0.7})
>>> await ml.add(content="api-gateway p99 SLO is 250ms", source="runbook.platform", confidence=0.95)
>>> await ml.add(content="api-gateway p99 SLO is 400ms", source="slack.oncall", confidence=0.6)
>>> hits = await ml.search("api-gateway SLO", top_k=3)
>>> [(h.content, h.metadata["_effective_confidence"], h.confidence_flag) for h in hits]
[('api-gateway p99 SLO is 250ms', 0.95, 'PASS'), ('api-gateway p99 SLO is 400ms', 0.60, 'FLAG: conflict with chain://runbook.platform')]

From pip install to a governed memory in a few lines.

Architecture

One trust layer. Any storage. Any eval framework

memledger sits between your agents and storage, applying provenance, confidence, conflict, and audit guarantees on every operation. Eval frameworks score MAI from above; backends serve from below.

APPLICATIONEVALMEMLEDGERSTORAGEPython SDKkagent.devLangGraphOpenAI Agents SDKRAGASPhoenixDeepEvalLangSmithOpenAI EvalsmemledgerProvenanceConfidence GateConflict DetectorMAIAuditpgvectorAuroraOpenSearchDynamoDBCompositionLLM /EMBEDBedrockOpenAIAnthropicOllama
memledger in action

See trust at a glance

The Console UI surfaces every memory’s chain, conflicts, and Memory Quality Score breakdown — live, on the same memory the agent just used.

memledger UI Console — chain, conflicts, and MQS breakdown for a single memory
Use cases

Three problems memledger solves directly

Multi-agent contamination

One agent writes a low-confidence guess. Another reads it and treats it as ground truth. The bad belief propagates silently.

memledger gates retrieval on chain-bounded effective confidence. Below threshold, the memory is filtered or flagged before your agent ever sees it.

hits = await ml.search(
  query="connection pool fix",
  namespace="/ops/payment-svc",
  top_k=5,
  confidence_policy={"min_threshold": 0.5},
)
Read more →

Compliance & RTBF

A user invokes GDPR Art. 17. The memory you wrote is fine to delete — but ten derivatives across three agents reference it.

memledger plans the cascade across derivatives, shows you exactly what will be deleted, and executes with a signed audit record.

plan = await ml.plan_cascade(memory_id=incident_id)
result = await ml.execute_cascade(
  plan_id=plan.id,
  reason="GDPR Art. 17",
  requester_id="dpo@org",
)
Read more →

Continuous trust scoring

You ship an agent. It works in eval. Three weeks later, retrieval drift has degraded answers and you have no signal.

memledger’s MAI rubric runs in your existing eval stack. Score Memory Attribution Integrity on every release; alert when it slips.

from evaluators.attribution_integrity_ragas import evaluate_mai_ragas

report = await evaluate_mai_ragas(
  ledger=ml,
  dataset="calibration-30",
)
print(report.summary)
Read more →
Who memledger is for

Built for the people who get paged

SRE & platform engineers

Diagnose how agent recommendations went wrong — chain, conflicts, and confidence in one trace.

ML platform leads

Gate retrieval on chain-bounded effective confidence. Sane defaults, tunable per workload, no lock-in.

Security & compliance teams

Audit every memory’s provenance and run RTBF cascades through derivatives. Apache 2.0; deploy in your VPC.

Agent framework builders

Drop memledger under LangGraph, OpenAI Agents SDK, or kagent. The trust layer is framework-agnostic.

Researchers & students

A reference implementation of provenance, weakest-link confidence, and MAI you can read end to end.

Anyone shipping multi-agent AI

If two agents share memory, you need attribution. memledger gives you that without rewriting your stack.