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.1.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.1-py3-none-any.whl (192.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: memledger-2.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ca2eb81dc9f504721c07b48d0f200f06022712c51e2417c36de672ae4f1fd7a9
MD5 4ca941c82efedd73087f166ab843cda5
BLAKE2b-256 035342d642181ae73876b2a016a137975be3581b6a587b827a472440dea0e085

See more details on using hashes here.

Provenance

The following attestation bundles were made for memledger-2.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: memledger-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 192.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aeb9e3dfc2eeb4956bab089ec2c7bea92f44e3d2c4b224b2914d3c5f91dd2bf
MD5 9c1b9499ebfcaf7f9245b012fba0b338
BLAKE2b-256 fcaeb9c0975cffb10ba56a85275c72fc6bda0cfbf74c5941a0e2c516b9e5f530

See more details on using hashes here.

Provenance

The following attestation bundles were made for memledger-2.0.1-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