Skip to main content
Glama

A durable, local-first memory layer for AI coding agents.

The filesystem is the memory · the index is disposable · every session is provable.

CI Docs License: MIT Python 3.12+ Docs site

Documentation · User guide · Specification · Harness adapters


Why

Agents that matter forget things that matter: your stack, your rules, your decisions from last Tuesday. Vector databases and cloud memory services solve this with infrastructure. Memex solves it with a filesystem:

  • The filesystem is the memory. Every memory is a Markdown page under ~/.memex/docs/ — human-readable, git-able, editable by hand, portable forever. No blobs, no lock-in, no server.

  • The index is disposable. SQLite FTS5 provides fast BM25 search, and it is never the source of truth: delete mem.db, run memex rebuild-index, everything comes back from the pages.

  • Every session is provable. Captured transcripts link to episode nodes, so any memory traces back to the conversation that produced it.

Related MCP server: exomem

Agents forget to call tools — memex doesn't rely on them remembering

Layer

Mechanism

Guarantee

Pull

8 typed MCP tools (memex serve-mcp)

The model can read/write memory when it chooses

Push

Harness hooks (memex hook …)

Memories are injected into context every turn; transcripts are captured automatically

Proof

memex verify in CI

Health and memory-activity evidence — or the build fails

One contract, every harness:

Harness

Push

Pull

Transcript capture

pi

per-turn injection (extension)

stdio MCP

session JSONL

Claude Code

SessionStart / UserPromptSubmit / SessionEnd hooks

stdio MCP

transcript

Codex

AGENTS.md contract + notify

stdio MCP

rollout

GitHub Copilot

CI carries it

remote (future)

memex verify workflow

memex install              # interactive: pick a harness
memex install claude        # or codex, pi, copilot, custom

Quickstart

# install (Python 3.12+)
uv tool install --path . memex

# store a memory — it's a plain Markdown page
memex write --type preference --title "Deploy on Fridays" \
    --body "The team deploys to production on Fridays only." --tags deploy

# recall it — BM25-ranked, snippet-highlighted
memex recall "deploy"

# read it, edit it by hand, commit it to git
cat ~/.memex/docs/preferences/deploy-on-fridays.md
from memex import Memex, WriteInput

memex = Memex()
memex.write(WriteInput(type="entity", title="Ruff linter", body="Fast linter."))
result = memex.recall("linter", top_k=3)
provenance = memex.get_provenance(result.hits[0].slug)
memex.close()

memex_write · memex_recall · memex_consolidate · memex_forget · memex_ingest_transcript · memex_provenance · memex_export · memex_import

claude mcp add memex -- memex serve-mcp
memex verify --since "$PR_CREATED" --require-recall --require-write

Always checks: every page parses, the index matches content hashes, every [[link]] resolves. With --since, enforces recall/write activity evidence. Exit 1 fails the build. Ready-made workflow: marketplace/copilot/memex-verify.yml.

Commands

Command

Purpose

write / recall

Store and search memory nodes (BM25, filters, snippets, expiry semantics)

forget

hard delete, soft retire, decay, or archive a memory

consolidate

LLM distillation of episodes into durable nodes — any OpenAI-compatible endpoint, or the coding harness itself (claude/codex/pi as provider)

ingest-transcript

Store a session JSONL + create the linked episode node

hook session-start | prompt | transcript

Harness hook contract: context injection + transcript capture

verify

Deterministic health + activity gate for CI

install

Seamless harness setup: adapters, MCP wiring, [consolidation] provisioning, or custom init

serve-mcp

stdio MCP server (official SDK)

rebuild-index / watch

Rebuild mem.db from the pages; poll for hand edits

backup / restore / export / import

Hardened tar.gz archives; JSON node portability

Documentation

📖 Documentation site

Guide, specification, implementation notes

🚀 User guide

Concepts, every operation, harness integration, config reference

📐 Specification

Memory model, schemas, C4 diagrams, acceptance tests

📝 Implementation notes

Spec deviations and the reasoning

🧩 Harness adapters

pi · Claude Code · Codex · GitHub Copilot

Contributing

uv sync --all-groups
uv run pytest && uv run ruff check . && uv run mypy src tests

Contributions welcome — see AGENTS.md for engineering conventions and the guide for architecture context.

License

MIT © Memex contributors

Memex stores memory as plain files on your machine and treats stored memories and tool inputs as untrusted: logs never contain memory contents, archives are validated before extraction, and tool errors are sanitized.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Durable memory with sources, proof, history, and review for MCP-capable agents. It turns a Markdown/Obsidian vault into a local knowledge substrate, enabling agents to store, search, and retrieve governed knowledge.
    10
    AGPL 3.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides portable memory for AI agents using plain Markdown files. Enables storing, recalling, and managing memories via MCP tools like recall, remember, forget, list, and get.
    1 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides a cross-session memory system for AI assistants via MCP, with markdown-based storage, BM25 retrieval, and tools for writing, searching, reading, and managing memories.
    10 npm
    MIT