Architecture Overview
Memproof is an embeddable library (Python & TypeScript) — not a standalone service. It runs in-process alongside your AI agent, intercepting every memory operation and routing it through a deterministic control path before it reaches the underlying memory backend.Memproof does not replace your memory store. It wraps it with risk assessment, policy enforcement, and audit logging.
Design Principles
- Adapter-first — storage and retrieval stay in your existing memory provider.
- Control-plane-first — every mutation passes through policy and risk checks before reaching the backend.
- Deterministic decisions — the same input combined with the same policy version always produces the same decision.
- Forensic-grade lineage — each pipeline stage emits an immutable event to the Trailproof audit trail.
- Progressive enforcement — deploy in
monitor,enforce, orstrictmodes as your confidence grows.
Component Diagram
Components
Operation Orchestrator
Central pipeline that normalizes requests, sequences the risk/policy/approval stages, and delegates to the adapter. See Control Path.
Risk Engine
Scores each operation across 5 weighted factors: operation type, PII detection, secrets detection, source trust, and scope anomalies. See Risk Engine.
Policy Engine
Evaluates YAML-defined rules in priority order. First matching rule wins. Produces one of four actions:
allow, deny, require_approval, or quarantine. See Policy Engine.Audit Trail
Tamper-evident audit trail powered by Trailproof. Records an event for every pipeline stage with SHA-256 hash chains and optional HMAC signing. See Audit Trail.
Approval Broker
Bridges
require_approval decisions to an external approval system (Attesta) or an internal manual queue.Quarantine Store
Retains the full payload of quarantined operations so they can be reviewed and released or discarded.
The Adapter Pattern
Memproof connects to any memory backend through theMemoryAdapter interface. Built-in adapters exist for LangGraph checkpoints, OpenAI Sessions, and MCP memory servers. You can also write a custom adapter for any backend.
NOT_FOUND, CONFLICT, VALIDATION_ERROR, PROVIDER_UNAVAILABLE, and PERMISSION_DENIED.
Instantiation
TheMemproof class wires all components together. A single constructor call is all you need:
Data Flow Summary
Every memory operation —remember, update, forget, search — follows the same six-stage control path:
- received — request accepted and normalized
- risk_assessed — risk score and factors computed
- policy_decided — action determined from YAML rules
- approval_requested — conditional, only for
require_approval - provider_attempted — adapter calls the memory backend
- committed or blocked — terminal state with full event trail