Generated banner for Memoripy v4
Generated logo for Memoripy v4

Memoripy v4

Memory server

Created by Khazar Ayaz

Published in caspianmoon/memoripy. Publisher page

691 GitHub stars

What it is

Evidence-first local memory for AI agents with temporal versions, admission policies, citations, explainable recall, MCP, and audit tooling.
— the description by Khazar Ayaz

AutoGineer overview, from the brain’s own files

Memoripy is an evidence-first memory runtime designed to provide AI agents with structured, verifiable, and persistent memory. It operates by capturing evidence and managing it through a lifecycle that includes admission, deferral, rejection, or quarantine of candidate memories. The system maintains both current and historical versions of data, allowing for temporal tracking. Retrieval is handled through independent lanes and rank fusion, ensuring that agents receive a scoped and cited context pack. Additionally, Memoripy includes audit tooling to provide transparency into what the system has remembered and the reasoning behind those memory decisions.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

The system functions as a memory runtime that processes information through six core operations: capturing evidence, applying admission policies to filter candidates, preserving temporal versions, retrieving data via rank fusion, building cited context packs, and auditing memory state. It utilizes a hybrid memory model and supports integration via an official MCP server, a CLI, and a REST API, with storage capabilities provided by PostgreSQL.

Folders
FolderRoleFiles
.githubagent-config4
docsdocs20
examplesexamples4
teststests11
benchmarksfolder3
memoripyfolder32

Requirements

Runtimes: Python >=3.10

Databases: PostgreSQL

API keys (by name): MEMORIPY_API_KEY

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 1 script. Review setup.py before opening the folder in Claude Code. No step below turns a hook on for you.

    • setup.py: python setup.py
  2. Not scanned by AutoGineerThe author’s README also describes installing it from a clone of its repository. Read its install section: AutoGineer did not scan that path. https://github.com/caspianmoon/memoripy/blob/42316ca5d49f7df3d91afbf93e65871b33c588ad/README.md#install-v4-from-source
  3. Not scanned by AutoGineerAutoGineer could not scan everything it runs. https://pypi.org/project/memoripy/
  4. Created by Khazar Ayaz. Published in caspianmoon/memoripy. Licence: Apache License 2.0.

Usage

AutoGineer overview, from the brain’s own files

  • Integrating memory into AI agents via the MCP server
  • Managing memory lifecycles with admission and quarantine policies
  • Auditing agent memory state for transparency
  • Retrieving cited context for agent tasks
  • Tracking historical memory versions
“Retrieve all evidence regarding project X from the last month.”
The system returns a cited context pack containing the relevant temporal versions of memories associated with project X.
“Audit the memory admission for the recent user interaction.”
The system provides an explanation of why the interaction was admitted or rejected based on the configured admission policies.

Documentation by Khazar Ayaz

Read the documentation at the source

docs/v4-architecture.md

Memoripy v4 architecture

Design goals

V4 is designed around four requirements:

  • Durable memory must be supported by evidence.

  • Current truth must remain distinguishable from historical truth.

  • Retrieval signals must not silently exclude one another.

  • Memory lifecycle decisions must be inspectable.

Core objects

EvidenceItem

An evidence item records the source material encountered by the system. It includes source type, role, writer, trust, scope, occurrence time, URI, content hash, and whether the content was itself retrieved from memory.

Evidence is not automatically a durable memory.

MemoryCandidate

An extractor produces a candidate with a typed key, value, subject, confidence, durability, validity period, evidence spans, and proposed memory layer.

AdmissionDecision

The admission policy decides whether a candidate is accepted, deferred, rejected, or quarantined. It returns reason codes and the proposed trust and durability classifications.

MemoryRecord

A record is the current view of a canonical memory slot. It points to immutable versions and supporting evidence.

MemoryVersion

A version records an add, merge, supersession, correction, quarantine, or deletion. It contains its own value, state, validity, evidence, reasoning, and links to the version it superseded.

RetrievalReceipt

A receipt records which retrieval lanes found a result, the rank and contribution from each lane, the scope tier, the final fused score, and inclusion reasons.

ContextPack

A context pack is the scoped grounding surface returned to an application. It separates profile, preferences, relationships, policies, constraints, commitments, decisions, procedures, recent episodes, and tool observations.

Ingestion path

input
  -> normalize source envelope
  -> persist evidence
  -> extract candidates
  -> admission policy
  -> reconcile canonical slot
  -> write immutable version
  -> rebuild projections

A rejection still produces an admission-log entry. Quarantined content remains inspectable without becoming normal grounding material.

Retrieval path

query
  -> classify intent
  -> resolve scope tiers
  -> run independent lanes
  -> reciprocal-rank fusion
  -> filter by state, trust, and time
  -> build diverse context pack
  -> attach receipts and citations

Lexical matching does not gate semantic matching. Policy and temporal lanes can surface records that ordinary similarity would miss.

Bitemporal behavior

V4 distinguishes:

  • observed_at: when the underlying source says the event was observed

  • recorded_at: when Memoripy persisted it

  • valid_from: when the memory became true

  • valid_to: when it stopped being true

A current query excludes expired versions. A historical query can materialize prior versions as read-only results with synthetic identifiers such as memory_id@version_id.

Brain mode

attention_fast maintains activation and dormancy but separates retrieval frequency from utility. The projection tracks rehearsal, retrieval, context inclusion, success, correction, rejection, and failure signals.

Consolidation requires independent evidence support. Recalled copies of the same memory do not count as new evidence.

Persistence

The file repository uses:

  • a lock file

  • an atomic state replacement

  • a known-good backup

  • a checksum

  • a transaction journal

  • append-only events

  • state validation before commit

A malformed state file raises MemoryCorruptionError. It is never treated as an empty store.

88 files · 62 not served here

Advantages

Limitations

Security

Risk level: Low risk

This brain runs

Install scripts (1)

  • setup.py: python setup.py
  • Low risk: scripts-present (setup.py)

Attribution and licence

Created by
Khazar Ayaz
Declared authors
  • Khazar Ayaz (declared in pyproject.toml)
Publisher
Khazar Ayaz (Community)
Source
caspianmoon/memoripy · commit 42316ca
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Khazar Ayaz.

Install from source

62 of its files are not served here, so there is no ZIP. caspianmoon/memoripy at 42316ca