okf-memory/okf-agent-memory
Git-native MCP memory that keeps agent rules in context and project facts on demand
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
OKF Agent Memory splits persistent project context into two layers. At session start, AGENTS.md supplies standing rules and search-before-write triggers, with Agent Action Grammar as the compact notation. Facts, decisions, and runbooks live in a linked Open Knowledge Format bundle under knowledge/. An agent can query the in-memory BM25 index with okf_search and open a specific record with okf_show, rather than loading the entire bundle into context.
cmd/okf builds the CLI and embedded stdio MCP server into one executable. go.mod targets Go 1.26.0 and lists golang.org/x/crypto v0.59.0 directly and golang.org/x/sys v0.50.0 indirectly. Markdown with YAML frontmatter is the durable store; Git supplies a reviewable history, and local retrieval requires neither a database nor an inference runtime. The triggers guide the agent, but are not a runtime policy enforcement mechanism.
Key Capabilities & Differentiators
Search and lookup resolve duplicate concept IDs in project > vendor > user > system order, with explicit identifiers available for nonproject scopes. All four scopes are active by default; an allowlist in knowledge/index.md limits both default discovery and explicit queries to permitted layers. search --for-path finds constraints and active holds tied to a source path, validate --drift-git detects referenced files that changed after governing concepts, and changes --since 7d --json supports handoffs and reviews.
Bundle validation covers conformance, graph connectivity, and description drift. The scorecard assigns 35% to maintenance, 35% to human stewardship, and 30% to graph integrity. JSON output supports automation, while --min-score can gate validation, vendor pulls, and restoration of locked bundles. Retrieval is lexical and model-independent. Gemma, Qwen, and Llama are examples for the separate benchmark suite through LM Studio or Ollama, not inference dependencies of the memory service.
Trade-offs & Limitations
Compared with keeping all project knowledge in AGENTS.md, selective retrieval reduces always-loaded context but creates a new failure mode: the agent may not query memory when it should. Compared with embedding-backed RAG, BM25 avoids an embedding pipeline and a separate vector service, and is a good fit for exact identifiers and established project vocabulary. It is less suited to paraphrases with little term overlap. Evaluate representative queries and measure prompt savings end to end; an index lookup does not include MCP overhead, tool-call tokens, or model latency.
Git provides familiar diffs and code review, but teams still need to maintain frontmatter, review stale records, and decide who can change shared knowledge. Because user and system scopes are enabled by default, explicitly restrict scopes for client or public repositories where personal or machine-wide notes should not be visible. Treat vendor content as untrusted input: a passing quality score or write protection does not make retrieved instructions authoritative.
Hardware & Deployment Guide
Build from source with make build using the Go 1.26.0 target in go.mod; the executable is written to bin/okf. Use okf init for a bare bundle or okf bootstrap to scaffold the bundle, agent skill, AGENTS.md, and Makefile. Run ./bin/okf mcp knowledge from the project or configure the client with absolute executable and bundle paths. Local operation needs no separate database, container, or GPU; budget CPU and RAM against the size of the enabled corpus rather than model parameters.
Registry and Git pulls, vendor restoration, and encrypted Hub sync are optional paths, not prerequisites for local retrieval. v0.8.0 introduced scope isolation and concurrent-write safeguards. v0.9.0 added OKF v0.3 conformance with v0.2 fallbacks, programmatic write protection, change history, and Git freshness checks. v0.9.1 fixes CommonMark angle-bracket link destinations and out-of-bundle path classification. For upgrades from v0.9.0, revalidate bundles that use either link form.
AGENTS.md keeps standing rules separate from linked Markdown/YAML knowledge retrieved on demand.okf mcp <bundle> serves tools over stdio from the same Go binary as the CLI.scopes allowlist rejects queries to disabled layers.search --for-path surfaces file-specific constraints, while validate --drift-git flags referenced files changed after their governing concepts.validate --scorecard --json reports maintenance, human stewardship, and graph integrity; --min-score enforces a threshold.Teams using MCP-capable coding agents that want Git-reviewed decisions, runbooks, and file-specific constraints without loading all project knowledge into every session.
A short AGENTS.md already covers the project, or your primary need is semantic recall across a large or loosely structured corpus rather than curated Markdown records.
Quick Start & Installation
make build
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| okf-agent-memory ★ | 882 | +9 | Go | MIT | Git-native MCP memory that keeps agent rules in context and project facts on dem |
| archify | 103.1k | +2k | JavaScript | Apache-2.0 | Agent skill and Node CLI for source-backed, interactive architecture diagrams. |
| graphify | 156.8k | +2.4k | Python | Apache-2.0 | Local AST graphs for dependency tracing, with CLI and MCP access. |
| i-have-adhd | 64.1k | +1.3k | Python | MIT | A coding-agent skill that puts the next action first |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/okf-memory/okf-agent-memory.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about okf-agent-memory
How do I connect an agent to project memory?
/path/to/bin/okf with arguments mcp and /path/to/project/knowledge. The client communicates with the process over stdio. Exposing the tools does not make the agent call them: use AGENTS.md to specify when to search and when to read the full record.Does it need a GPU, and how should I size it?
Can a company self-host it and use it commercially?
When is this better than a plain `AGENTS.md` or a vector store?
AGENTS.md alone when the rules are short, stable, and needed every session. Choose OKF when decisions and runbooks have grown large enough to warrant selective retrieval, links, and Git review. Prefer embedding-based retrieval when finding paraphrases with little vocabulary overlap matters more than keeping the retrieval stack database-free and model-free.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy