MCP Connector

Store and retrieve AI agent memory as Git-native markdown files

OKF Agent Memory is a git-native, MIT-licensed persistent memory layer for AI agents, stored as plain Markdown with BM25 search and zero API cost.

Works with gitgithubclaudecursor

90
Spark score
out of 100
Updated 10 days ago
Source checked Sep 10, 2026
Version 0.1.5
Models
claudegemini 2 0universal

Add to Favorites

Why it matters

Persist AI agent conversations, architectural decisions, and domain knowledge as version-controlled markdown files in your repository, eliminating context loss between sessions and enabling fast local search without vector databases or API costs.

Outcomes

What it gets done

01

Search agent memory with sub-millisecond BM25 retrieval across concept graphs

02

Validate knowledge bundles for schema compliance and relationship integrity

03

Bootstrap persistent memory structure into any project repository

04

Serve memory operations via Model Context Protocol for Claude and Cursor

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Capabilities

Tools your agent gets

validate

Validate OKF bundle conformance, graph connectivity, and description drift.

search

Search concepts via in-memory BM25 scoring across the knowledge bundle.

show

Inspect a concept and its relationships with optional JSON output.

create

Create a new concept with automated log.md and index.md bookkeeping.

update

Update an existing concept in the knowledge bundle.

bootstrap

Bootstrap full OKF Agent Memory stack into any target project.

init

Initialize a bare OKF bundle in any directory.

mcp

Run as a Model Context Protocol server over stdio for agent integration.

Overview

Okf Agent Memory

OKF Agent Memory stores AI agent project memory as version-controlled Markdown files with YAML frontmatter, searchable via in-memory BM25 in under 300 microseconds with zero embedding-API cost. It carries provenance, trust tiers, and lifecycle metadata, and ships an MCP server for direct use from Claude Code, Cursor, or Codex. Use it when a project's AI agents need memory that survives a closed context window without adopting a vector database or letting ad-hoc notes sprawl unstructured.

What it does

OKF Agent Memory is a domain-neutral, git-native persistent memory layer for AI agents, built on Google's Open Knowledge Format (OKF) v0.2. Instead of a vector database or ad-hoc CLAUDE.md/AGENTS.md notes, project memory lives directly in the repository as plain Markdown files with YAML frontmatter under knowledge/, so it can be inspected, audited, and reviewed with ordinary git diff and git log. Concept search runs on in-memory BM25 lexical retrieval - under 300 microseconds per query and a claimed ~4ms to parse and validate a full knowledge corpus of 50+ concepts with its bidirectional link graph - with zero recurring embedding-API cost since nothing goes over the network. Progressive Disclosure (hierarchical index.md files and link graphs) means an agent only loads the specific concepts it needs rather than the whole corpus, and the format carries provenance (sources), trust tiers (generated vs verified), and lifecycle metadata (status, stale_after) so stale or unverified memory can be distinguished from confirmed fact. A search-before-write convention is meant to stop agents from duplicating or hallucinating concepts that already exist in memory. The whole toolchain is a single zero-dependency Go binary (okf) with sub-5ms CLI startup and a built-in Model Context Protocol server (okf mcp) that connects directly to Claude Code, Cursor, Codex, and other MCP-compatible agent platforms.

CLI commands cover the full lifecycle: validate bundle conformance and graph connectivity (okf validate knowledge --strict --drift), search concepts (okf search "..." knowledge), inspect one concept and its relationships (okf show ... --json), create or update a concept with automated log.md/index.md bookkeeping (okf create/okf update), and scaffold the entire memory stack - the knowledge/ bundle, an embedded .agents/skills/okf-memory/ skill definition, a project-tailored AGENTS.md, and a convenience Makefile - into any new or existing project with one command:

./bin/okf bootstrap /path/to/my-project --name "My Service"

When to use - and when NOT to

Use it when a project's AI agents need memory that survives a closed context window - architectural decisions, domain discoveries, operational facts - without adopting a black-box vector database or letting ad-hoc CLAUDE.md/AGENTS.md notes sprawl unstructured. It is deliberately domain-neutral, with reference bundles for software architecture/ADRs, executive coaching sessions, and literature/cognitive-science reviews, so it is not tied to one workflow. It is a lexical (BM25) retrieval system, not a semantic vector-embedding one - the tradeoff for zero API cost and microsecond latency is that search is keyword-based rather than embedding-based.

Capabilities

Validates OKF bundle conformance, graph connectivity, and description drift; searches concepts via in-memory BM25 scoring; inspects a concept and its relationships (with JSON output); creates and updates concepts with automatic log and index bookkeeping; bootstraps the full memory stack (knowledge bundle, agent skill, AGENTS.md, Makefile) into any project; and runs as an MCP server over stdio for direct use from Claude Code, Cursor, Codex, or any other MCP-compatible client.

How to install

Clone the repository and build the standalone binary:

make build

This produces bin/okf. Run it as an MCP server with ./bin/okf mcp knowledge, and register it in a client config such as:

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

A Homebrew formula is also packaged in the repository for distribution.

Who it's for

Teams running AI coding agents (or agents in coaching, research, or operations contexts) who want persistent, version-controlled, auditable project memory with no vector database, no embedding-API cost, and no vendor lock-in. MIT licensed.

Source README

OKF Agent Memory

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

Specification
Tooling
Protocol
License


๐ŸŒŸ Overview

Conversations with AI agents reset when context windows close. Valuable architectural decisions, domain discoveries, and operational facts are lost unless stored persistently.

OKF Agent Memory provides a standardized, vendor-neutral memory layer that lives directly in your repository (knowledge/) as plain Markdown files with YAML frontmatter. It bridges the gap between 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

โšก Key Highlights

  • Blazing Fast Performance (<300ยตs Search, ~4ms Graph Validation): In-memory BM25 retrieval and bundle validation execute in microseconds without VM spin-up or network roundtrips.
  • 100% Git-Native & Zero Vendor Lock-in: Everything is version-controlled plain text. Inspect, audit, and review your agent's memory using standard git diff and git log. No external database required.
  • Zero API Costs for Memory Retrieval: Local lexical BM25 indexing eliminates recurring vector embedding API costs and network roundtrips.
  • Built on Google OKF v0.2: Uses the open standard format for agent knowledge with full support for provenance (sources), trust tiers (generated vs. verified), and lifecycle metadata (status, stale_after).
  • Solves Context Bloat & Memory Rot: Employs Progressive Disclosure (hierarchical index.md files and link graphs) so agents only load the exact concepts they need.
  • Search-Before-Write Principle: Mandates querying existing memory before authoring, preventing concept duplication and hallucinated divergence.
  • Zero-Dependency Go Toolchain: Single binary with zero external 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.

๐Ÿ“Š Performance Benchmarks

Built in Go with zero external dependencies, okf is engineered for high-frequency agent tool 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 ms (50+ concepts, bidirectional graph)
Process Cold-Start Overhead 250ms - 600ms (Python VM boot) 80ms - 180ms (V8 / Deno boot) < 4 ms (Compiled Single Binary)
Retrieval Cost per 1,000 Queries ~$0.10 - $0.50 (Embedding tokens) $0.00 $0.00 (Zero API cost, fully local)
Memory Footprint (RSS) ~120 MB - 350 MB ~60 MB - 140 MB < 15 MB

๐Ÿš€ Quickstart

1. Build the Tooling

Clone the repository and compile the standalone okf executable:

make build

This generates the standalone binary at bin/okf.

2. Basic CLI Commands

# Validate bundle conformance, graph connectivity, and description drift
./bin/okf validate knowledge --strict --drift

# Search concepts via in-memory BM25 scoring
./bin/okf search "architecture layers" knowledge

# Inspect a concept and its relationships (with --json support)
./bin/okf show architecture/layers knowledge --json

# Create a new concept with automated log.md and index.md bookkeeping
./bin/okf create decisions/auth-flow knowledge \
  --type Decision \
  --title "OAuth2 Authorization Flow" \
  --desc "Standardized on PKCE for client authentication."

# Update an existing concept
./bin/okf update decisions/auth-flow knowledge \
  --desc "Updated OAuth2 PKCE token refresh interval."

# Bootstrap full agent memory stack into any target project
./bin/okf bootstrap /path/to/project --name "My Project"

# Initialize only a bare OKF bundle in any directory
./bin/okf init my-project/knowledge

3. Bootstrapping Agent Memory in Any Project

Scaffold the complete OKF Agent Memory architecture into any new or existing repository with a single command:

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

This automatically sets up:

  • knowledge/ - OKF v0.2 compliant persistent memory bundle (index.md, log.md)
  • .agents/skills/okf-memory/ - Embedded agent skill definition and capability guides
  • AGENTS.md - Project-tailored operating instructions for AI coding agents
  • Makefile - Convenience tasks for validation (make validate) and search (make search q="...")

4. Running as an MCP Server

okf ships with a native Model Context Protocol (MCP) server over stdio to seamlessly connect with Claude Code, Cursor, Codex, and other agent platforms:

./bin/okf mcp knowledge
Example MCP Configuration (claude_desktop_config.json or Cursor):
{
  "mcpServers": {
    "okf-memory": {
      "command": "/path/to/okf-agent-memory/bin/okf",
      "args": ["mcp", "/path/to/project/knowledge"]
    }
  }
}

๐Ÿ“‚ Repository Structure

okf-agent-memory/
โ”œโ”€โ”€ benchmarks/             # Progressive disclosure benchmark suite & hardware test data
โ”‚   โ”œโ”€โ”€ data/               # Monolith docs vs OKF bundle test fixtures
โ”‚   โ””โ”€โ”€ results/            # Reproducible benchmark logs across 8+ local & cloud LLMs
โ”œโ”€โ”€ cmd/
โ”‚   โ”œโ”€โ”€ okf/                # Standalone CLI and embedded MCP server (`stdio`)
โ”‚   โ””โ”€โ”€ okf-benchmark/      # Automated benchmark runner for LLM TTFT & token measurements
โ”œโ”€โ”€ docs/                   # Guides, specifications, architecture & release playbook
โ”‚   โ”œโ”€โ”€ AGENT_TESTING.md    # Multi-agent testing, prompt scenarios & compatibility matrix
โ”‚   โ”œโ”€โ”€ ALTERNATIVES.md     # Comparison against Mem0, Letta, and ad-hoc markdown
โ”‚   โ”œโ”€โ”€ CLI.md              # Complete command-line & MCP tool 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 release process & version tagging
โ”‚   โ”œโ”€โ”€ ROADMAP.md          # Project roadmap & milestones
โ”‚   โ””โ”€โ”€ SECURITY.md         # Data governance, secret prevention & PII rules
โ”œโ”€โ”€ examples/               # Domain-neutral reference OKF v0.2 bundles
โ”‚   โ”œโ”€โ”€ books/              # Literature & cognitive science knowledge bundle
โ”‚   โ”œโ”€โ”€ coaching/           # Executive coaching & client session bundle
โ”‚   โ””โ”€โ”€ software/           # Microservices architecture & ADR bundle
โ”œโ”€โ”€ knowledge/              # Project's own OKF v0.2 persistent memory bundle
โ”‚   โ”œโ”€โ”€ index.md            # Root progressive disclosure index (okf_version: "0.2")
โ”‚   โ”œโ”€โ”€ log.md              # Dated change log (ISO 8601 YYYY-MM-DD)
โ”‚   โ”œโ”€โ”€ project/            # Overview & value propositions
โ”‚   โ”œโ”€โ”€ architecture/       # 5-tier architecture & tooling decisions
โ”‚   โ”œโ”€โ”€ convention/         # Principles & lifecycle workflows
โ”‚   โ””โ”€โ”€ roadmap/            # Milestones
โ”œโ”€โ”€ packaging/              # Distribution packaging
โ”‚   โ””โ”€โ”€ homebrew/           # Official Homebrew formula & tap instructions
โ”œโ”€โ”€ pkg/okf/                # Zero-dependency Go core library (parser, validator, BM25, MCP, bootstrap)
โ”œโ”€โ”€ AGENTS.md               # Operating instructions for AI coding agents
โ”œโ”€โ”€ CONTRIBUTING.md         # Contribution guidelines & development workflow
โ”œโ”€โ”€ Makefile                # Build, test, lint, validation & release targets
โ”œโ”€โ”€ LICENSE                 # MIT License
โ”œโ”€โ”€ README.md               # Main repository documentation
โ””โ”€โ”€ SECURITY.md             # Security policy & reporting guidelines

๐Ÿงช Testing & Verification

Run the full test suite and validate the repository's self-documenting knowledge bundle:

make check

๐Ÿ“– Further Documentation


๐Ÿ“„ License

MIT License. See LICENSE for details.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.