okf-memory/okf-agent-memory
Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.
What it solves
AI agents often lose critical architectural decisions, domain knowledge, and operational facts once their context window closes. This project provides a persistent, vendor-neutral memory layer that allows agents to store and retrieve knowledge without relying on expensive, black-box vector databases or unstructured markdown files.
How it works
It implements the Open Knowledge Format (OKF) v0.2, storing knowledge as plain Markdown files with YAML frontmatter directly in a project's repository (within a knowledge/ folder). It uses a zero-dependency Go toolchain to provide fast, local lexical search (BM25) and graph validation. To integrate with AI agents, it includes a built-in Model Context Protocol (MCP) server, allowing agents to query and update their own persistent memory.
Who it’s for
Developers and AI agent users who want a version-controlled, transparent, and low-latency memory system for their agents across various domains, including software engineering, scientific research, and operations.
Highlights
- Git-Native: All memory is stored as plain text, making it auditable via
git diffandgit logwith no external database required. - High Performance: Features sub-300µs search latency and sub-5ms CLI startup times using a compiled Go binary.
- Zero API Costs: Uses local BM25 indexing instead of embedding APIs, eliminating recurring costs for memory retrieval.
- MCP Ready: Includes a native Model Context Protocol server for seamless connection to platforms like Claude Code and Cursor.
- Progressive Disclosure: Uses hierarchical index files and link graphs to prevent context bloat by loading only necessary concepts.
Related
- Project
- Project
- Project
- Project