Skip to main content

Memory governance and trust layer for AI agents — provenance, attribution, confidence gating

Project description

memledger

Memory governance and trust layer for multi-agent AI systems.

memledger adds attribution, provenance, confidence gating, and quality measurement on top of any vector-backed memory store. Every memory carries a source, a confidence score, a derivation chain, and an audit trail — so when agents share memory, trust transfers become legible instead of invisible.

v2.0.0 — AWS-native release. Stable API; subsequent releases follow SemVer.

Why memledger

Existing memory frameworks (Mem0, Zep, Letta, AgentCore Memory) optimize for recall quality — how accurately the system retrieves relevant memory. None of them address accountability: who wrote this memory, how confident were they, what did they derive it from, and how has it been used since.

In a single-agent system, the accountability gap is academic. In a multi-agent system where agents read and act on each other's beliefs, it is the fault line where systems fail at scale.

What v2.0.0 ships

  • Attribution — every memory carries created_by, confidence, session_id, derived_from, supersedes, workflow_id, triggered_by, hedged, namespace
  • Weakest-link provenance chain — derivation chains tracked across agent boundaries; effective confidence for retrieval is min(declared, chain.min_confidence) — a high-conf claim built on a low-conf ancestor cannot outscore its weakest link
  • Confidence-gated retrievalPASS / FLAG / FILTER policy applied at search time, against effective confidence
  • Namespace RBAC — declarative per-agent access control over hierarchical namespaces; add() and search() both gate on it
  • 3-tier evaluation suite — deterministic Memory Attribution Integrity (record-quality view) + RAGAS LLM-as-judge (provider-agnostic via LiteLLM; verified end-to-end on Bedrock Sonnet) + structural evaluator (OTEL-span based, no LLM)
  • AWS-native backends — Aurora PostgreSQL with IAM auth, OpenSearch with SigV4 + faiss + hybrid RRF, Bedrock for embeddings (Titan v2) and the LLM strategy layer (Sonnet)
  • OpenTelemetry observability — every operation emits an OTLP span with memledger.* trust attributes; tier-1 set to OpenInference span kinds so Arize Phoenix categorizes them out of the box
  • Outcome feedback looprecord_outcome() updates memory confidence based on observed downstream outcomes
  • MCP server — framework-agnostic adoption via Model Context Protocol

Full architecture, concepts, and API reference at memledger.com/docs.

Install

The OSS-default install needs no cloud credentials:

pip install 'memledger[oss]'

The AWS-native install:

pip install 'memledger[aws]'                # Aurora pgvector + Bedrock
pip install 'memledger[aws,opensearch]'     # add OpenSearch backend

Other extras (combine as needed):

Extra Use
[oss] Local ONNX embeddings + Postgres + pgvector — no cloud keys
[aws] Aurora pgvector + Bedrock embeddings + Bedrock judge
[opensearch] Amazon OpenSearch backend (SigV4 + faiss + hybrid RRF)
[eval] RAGAS LLM-as-judge (Tier 2 of the eval suite)
[telemetry] Phoenix-OTEL helper on top of the core OTEL stack
[mcp] MCP server for framework-agnostic adoption

Backend contract: the only required backend is open-source PostgreSQL ≥ 14 with the pgvector extension ≥ 0.5. Aurora, RDS, Supabase, Neon — same backend, only the DSN changes.

Quick start (60 seconds)

# 1. Postgres + pgvector locally
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres pgvector/pgvector:pg16

# 2. Install
pip install 'memledger[oss]'
# 3. Write + search one memory
import asyncio
from memledger import Memledger

async def main():
    ml = await Memledger.create(
        backend_name="pgvector",
        connection_string="postgresql://postgres:postgres@localhost:5432/postgres",
    )
    await ml.add(
        content="HikariCP maxPoolSize=50 fixes payment-service OOM",
        namespace="/ops/incidents/payment-svc",
        confidence=0.9,
        created_by="ops-agent",
    )
    results = await ml.search(
        query="connection pool fix",
        namespace="/ops/incidents/payment-svc",
    )
    for r in results.records:
        print(r.confidence, r.created_by, "::", r.content)
    await ml.close()

asyncio.run(main())

For multi-agent walkthroughs (weakest-link gate, contamination interception, eval pipeline), see memledger.com/docs/concepts/provenance-chain.

CLI

memledger init                                  # write a starter memledger.yaml
memledger add "fact" --namespace /n --agent-id a --confidence 0.8
memledger search "query" --namespace /n --confidence-min 0.6
memledger get <memory-id> --chain
memledger eval <session-id>
memledger status

memledger --help for the full surface.

Roadmap

Version What
v2.0 (this release) AWS-native trust layer; 3-tier eval suite; weakest-link confidence; namespace RBAC; MCP
v2.1 (Jun 15) DynamoDB backend with composition; LangGraph + OpenAI Agents SDK adapters; memledger lint CLI
v2.2 (Jun 30) Mem0 + Letta backend adapters; DeepEval + Phoenix Evals adapters
v3.0 (Jul 15) Eval feedback flywheel — outcomes drive automated memory promote/demote

License & support

Apache 2.0. License file ships in the PyPI sdist. For enterprise inquiries, repository access requests, or security disclosures, visit memledger.com.

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

memledger-2.0.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

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

memledger-2.0.0-py3-none-any.whl (192.0 kB view details)

Uploaded Python 3

File details

Details for the file memledger-2.0.0.tar.gz.

File metadata

  • Download URL: memledger-2.0.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memledger-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d08ead7296fa36bd9f1ae489188be1549dba8490a3bdae5d2a36bdff5f2f026a
MD5 88f6fac92685ead5cdab3442435d98ad
BLAKE2b-256 c2b0b2b063da1154fc18531cc1fa6d04d674fe7095377bb6b04d9643cabb998c

See more details on using hashes here.

Provenance

The following attestation bundles were made for memledger-2.0.0.tar.gz:

Publisher: release.yml on memledger-ai/memledger-core

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

File details

Details for the file memledger-2.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for memledger-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d442cb44538ec120dc4bcd22428c1ef208d7064667323555529b283982d5f417
MD5 2245b72fec6266ae15bc4b4fb3241d5a
BLAKE2b-256 56532c5ea38d90a63fe2155f3c90fd80d1e3869a310dcdec625e98720315a1f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for memledger-2.0.0-py3-none-any.whl:

Publisher: release.yml on memledger-ai/memledger-core

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