angelnicolasc/graymatter

30 sec to give your AI agents persistent memory. Reduce 90% token consumption while also maintaining quality.

What it solves

AI agents are typically stateless, meaning they forget everything between sessions. To maintain context, developers often re-inject the entire conversation history, which leads to linear growth in token usage, increased costs, and performance degradation. GrayMatter provides a persistent, embeddable memory layer that allows agents to remember facts across sessions without needing a full history injection.

How it works

GrayMatter operates as a single-binary, zero-dependency Go library or an MCP (Model Context Protocol) server. It uses a hybrid recall system combining vector, keyword, and recency signals to retrieve the top-8 most relevant facts for a given task. It features an asynchronous consolidation process that summarizes, decays, and prunes memories, and can automatically extract typed entities to build a self-populating knowledge graph. For specific clients like Claude Code, it can install hooks that automatically inject routine recall into the system prompt.

Who it’s for

Developers building AI agents or using MCP-compatible clients (such as Claude Code, Cursor, Codex, OpenCode, and Antigravity) who need a lightweight, offline, and vendor-independent way to give their agents long-term memory.

Highlights

  • Persistent Memory: Facts survive across sessions and are recalled by meaning rather than just keywords.
  • Token Efficiency: Reduces context tokens by up to 90% compared to full-history injection.
  • Self-Building Knowledge Graph: Automatically extracts entities and links them based on co-mention, exportable to Obsidian.
  • Zero Dependency: Distributed as a single ~10MB static binary with no requirement for Docker, Redis, or cloud accounts.
  • Observability: Includes a TUI (Terminal User Interface) workbench to browse, filter, and manage memories and the knowledge graph.
  • Curation: Supports deterministic decay (30-day half-life) and allows agents to self-curate memories via memory_reflect.

Related

  • Project
  • Project
  • Project
  • Project
  • Project