caspianmoon/memoripy

Evidence-first local memory for AI agents with temporal versions, admission policies, citations, explainable recall, MCP, and audit tooling.

What it solves

Memoripy is designed to prevent AI agents from suffering from "memory pollution"—the ingestion of noise, contradictory facts, or untrusted instructions. It solves the problem of maintaining a reliable, evidence-based memory store where the agent can track how facts change over time and explain exactly why a specific piece of information was recalled.

How it works

Memoripy implements a local memory runtime that prioritizes provenance and verification over simple storage. It uses several key mechanisms:

  • Admission Barrier: A formal policy that filters incoming data to reject noise, heartbeat signals, or untrusted external instructions before they become durable memories.
  • Bitemporal Records: It tracks both when a fact was observed and when it is valid, allowing the system to distinguish between current truth and historical evidence.
  • Multi-Lane Retrieval: Instead of relying on a single search method, it combines multiple "lanes" (lexical BM25, semantic similarity, entity overlap, etc.) using reciprocal-rank fusion to ensure the most relevant memory is found.
  • Receipts and Citations: Every recalled memory includes a "receipt" explaining the retrieval logic and citations linking back to the original source material.
  • Scope Isolation: Memory is strictly partitioned by user, agent, project, or organization to prevent data leakage across boundaries.

Who it’s for

Developers building AI agents that require high-reliability memory, strict data isolation, and the ability to audit the memory state for contradictions or poisoning.

Highlights

  • Evidence-First Approach: Prevents feedback loops by refusing to re-ingest retrieved memory as new evidence.
  • Local-First: Runs locally with no mandatory third-party dependencies, though it supports external embedding models and databases like Postgres/pgvector.
  • Audit CLI: A command-line tool to detect duplicates, conflicting facts, and sensitive data within a memory store.
  • MCP Server: Includes an official Model Context Protocol (MCP) server for easy integration with compatible agents.
  • Memory Contracts: A vendor-neutral framework to evaluate and benchmark memory behavior against specific test cases.

Related

  • Project
  • Project
  • Project
  • Project