OKF Agent Memory – Git-native persistent memory for AI coding agents

Sep 06, 2026 05:15 AM - 12 hours ago 4

A Domain-Neutral, Git-Native Persistent Project Memory for AI Agents based connected the Open Knowledge Format (OKF) v0.2.

Specification Tooling Protocol License


Conversations pinch AI agents reset erstwhile discourse windows close. Valuable architectural decisions, domain discoveries, and operational facts are mislaid unless stored persistently.

OKF Agent Memory provides a standardized, vendor-neutral representation furniture that lives straight successful your repository (knowledge/) arsenic plain Markdown files pinch YAML frontmatter. It bridges the spread betwixt unstructured ad-hoc markdown files (CLAUDE.md, AGENTS.md) and complex, black-box vector databases.

flowchart TD L1["1. OKF v0.2 Specification<br/>(Normative Markdown & YAML Format)"] L2["2. Agent Memory Convention<br/>(Behavioral Rules: Search, Review, Trust)"] L3["3. Agent Skill<br/>(LLM Prompts & Operational Workflows)"] L4["4. Tooling Layer: Go Library & CLI<br/>(Deterministic Parsing, Validation, Search, MCP)"] L5["5. Project Knowledge Corpus<br/>(knowledge/ OKF Bundle)"] L1 --> L2 L2 --> L3 L3 --> L4 L4 --> L5
Loading
  • Blazing Fast Performance (<300µs Search, ~4ms Graph Validation): In-memory BM25 retrieval and bundle validation execute successful microseconds without VM spin-up aliases web roundtrips.
  • 100% Git-Native & Zero Vendor Lock-in: Everything is version-controlled plain text. Inspect, audit, and reappraisal your agent's representation utilizing modular git diff and git log. No outer database required.
  • Zero API Costs for Memory Retrieval: Local lexical BM25 indexing eliminates recurring vector embedding API costs and web roundtrips.
  • Built connected Google OKF v0.2: Uses the unfastened modular format for supplier knowledge pinch afloat support for provenance (sources), spot tiers (generated vs. verified), and lifecycle metadata (status, stale_after).
  • Solves Context Bloat & Memory Rot: Employs Progressive Disclosure (hierarchical index.md files and nexus graphs) truthful agents only load the nonstop concepts they need.
  • Search-Before-Write Principle: Mandates querying existing representation earlier authoring, preventing conception plagiarism and hallucinated divergence.
  • Zero-Dependency Go Toolchain: Single binary pinch zero outer dependencies, sub-5ms CLI startup time, and a built-in Model Context Protocol (MCP) server (okf mcp).
  • Truly Domain-Neutral: Designed for Software Engineering, Coaching, Scientific Research, Literature Reviews, and Operations.

Built successful Go pinch zero outer dependencies, okf is engineered for high-frequency supplier instrumentality calling loops:

Benchmark Metric Python / Vector DB Runtimes (Mem0, Letta) Deno / Node.js Tooling OKF Agent Memory (Go)
Concept Search Latency 150ms – 800ms (Embedding API + Vector DB) 40ms – 120ms < 300 µs (Microseconds, In-Memory BM25)
Full Corpus Parse & Graph Validation 200ms – 1.5s 80ms – 250ms ~4.0 sclerosis (50+ concepts, bidirectional graph)
Process Cold-Start Overhead 250ms – 600ms (Python VM boot) 80ms – 180ms (V8 / Deno boot) < 4 sclerosis (Compiled Single Binary)
Retrieval Cost per 1,000 Queries ~$0.10 – $0.50 (Embedding tokens) $0.00 $0.00 (Zero API cost, afloat local)
Memory Footprint (RSS) ~120 MB – 350 MB ~60 MB – 140 MB < 15 MB

Tip

Reproduce Locally pinch your ain LLM: We supply an automated benchmark runner successful axenic Go to verify Time-To-First-Token (TTFT) speedups and -80% token simplification connected your section hardware (LM Studio / Ollama pinch Gemma, Qwen, Llama). Run make benchmark aliases research the Progressive Disclosure Benchmark Suite.


Clone the repository and compile the standalone okf executable:

This generates the standalone binary astatine bin/okf.

# Validate bundle conformance, chart connectivity, and explanation drift ./bin/okf validate knowledge --strict --drift # Search concepts via in-memory BM25 scoring ./bin/okf hunt "architecture layers" knowledge # Inspect a conception and its relationships (with --json support) ./bin/okf show architecture/layers knowledge --json # Create a caller conception pinch automated log.md and index.md bookkeeping ./bin/okf create decisions/auth-flow knowledge \ --type Decision \ --title "OAuth2 Authorization Flow" \ --desc "Standardized connected PKCE for customer authentication." # Update an existing concept ./bin/okf update decisions/auth-flow knowledge \ --desc "Updated OAuth2 PKCE token refresh interval." # Bootstrap afloat supplier representation stack into immoderate target project ./bin/okf bootstrap /path/to/project --name "My Project" # Initialize only a bare OKF bundle successful immoderate directory ./bin/okf init my-project/knowledge

3. Bootstrapping Agent Memory successful Any Project

Scaffold the complete OKF Agent Memory architecture into immoderate caller aliases existing repository pinch a azygous command:

# Bootstrap afloat representation stack into target project ./bin/okf bootstrap /path/to/my-project --name "My Service"

This automatically sets up:

  • knowledge/ — OKF v0.2 compliant persistent representation bundle (index.md, log.md)
  • .agents/skills/okf-memory/ — Embedded supplier accomplishment meaning and capacity guides
  • AGENTS.md — Project-tailored operating instructions for AI coding agents
  • Makefile — Convenience tasks for validation (make validate) and hunt (make hunt q="...")

4. Running arsenic an MCP Server

okf ships pinch a autochthonal Model Context Protocol (MCP) server complete stdio to seamlessly link pinch Claude Code, Cursor, Codex, and different supplier platforms:

Example MCP Configuration (claude_desktop_config.json aliases Cursor):

{ "mcpServers": { "okf-memory": { "command": "/path/to/okf-agent-memory/bin/okf", "args": ["mcp", "/path/to/project/knowledge"] } } }

okf-agent-memory/ ├── benchmarks/ # Progressive disclosure benchmark suite & hardware trial data │ ├── data/ # Monolith docs vs OKF bundle trial fixtures │ └── results/ # Reproducible benchmark logs crossed 8+ section & unreality LLMs ├── cmd/ │ ├── okf/ # Standalone CLI and embedded MCP server (`stdio`) │ └── okf-benchmark/ # Automated benchmark runner for LLM TTFT & token measurements ├── docs/ # Guides, specifications, architecture & merchandise playbook │ ├── AGENT_TESTING.md # Multi-agent testing, punctual scenarios & compatibility matrix │ ├── ALTERNATIVES.md # Comparison against Mem0, Letta, and ad-hoc markdown │ ├── CLI.md # Complete command-line & MCP instrumentality reference │ ├── CONVENTION.md # OKF Agent Memory Convention v0.1 │ ├── GETTING_STARTED.md # Comprehensive onboarding guide │ ├── OKF-COMPATIBILITY.md# OKF v0.2 spec compatibility analysis │ ├── RELEASE_PLAYBOOK.md # Automated merchandise process & type tagging │ ├── ROADMAP.md # Project roadmap & milestones │ └── SECURITY.md # Data governance, concealed prevention & PII rules ├── examples/ # Domain-neutral reference OKF v0.2 bundles │ ├── books/ # Literature & cognitive subject knowledge bundle │ ├── coaching/ # Executive coaching & customer convention bundle │ └── software/ # Microservices architecture & ADR bundle ├── knowledge/ # Project's ain OKF v0.2 persistent representation bundle │ ├── index.md # Root progressive disclosure scale (okf_version: "0.2") │ ├── log.md # Dated alteration log (ISO 8601 YYYY-MM-DD) │ ├── project/ # Overview & worth propositions │ ├── architecture/ # 5-tier architecture & tooling decisions │ ├── convention/ # Principles & lifecycle workflows │ └── roadmap/ # Milestones ├── packaging/ # Distribution packaging │ └── homebrew/ # Official Homebrew look & pat instructions ├── pkg/okf/ # Zero-dependency Go halfway room (parser, validator, BM25, MCP, bootstrap) ├── AGENTS.md # Operating instructions for AI coding agents ├── CONTRIBUTING.md # Contribution guidelines & improvement workflow ├── Makefile # Build, test, lint, validation & merchandise targets ├── LICENSE # MIT License ├── README.md # Main repository documentation └── SECURITY.md # Security argumentation & reporting guidelines

Run the afloat trial suite and validate the repository's self-documenting knowledge bundle:


  • Getting Started Guide — Comprehensive onboarding guideline for agents and humans.
  • CLI & MCP Reference — Complete command-line and protocol devices reference.
  • Contributing Guide — Development setup, value gates, and propulsion petition standards.
  • Security & Privacy Guidelines — Data governance, concealed prevention, and PII protection rules.
  • Multi-Agent Testing & Evaluation — Test scenarios, compatibility matrix, and benchmarks.
  • OKF Agent Memory Convention v0.1 — Behavioral rules and lifecycle specification.
  • Project Roadmap & Milestones — Phased improvement plan.
  • Release Playbook — Versioning, CI/CD pipeline, and distribution procedures.
  • OKF v0.2 Compatibility Matrix — Specification validation analysis.
  • Why OKF Agent Memory? — Detailed worth proposition & differentiators.
  • Alternatives & Ecosystem Comparison — Comparison pinch Mem0, Letta, and ad-hoc markdown files.

MIT License. See LICENSE for details.

More