Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
okf-agent-memory

okf-agent-memory

> AI 编程
Free

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memo

503 stars0 likes3 views
WebsiteGitHub

About

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memo

OKF Agent Memory

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


Overview

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

Traditional approaches suffer from two fatal failure modes:

  1. The Prompt Monolith: Stuffing all domain knowledge and rules into AGENTS.md or CLAUDE.md creates massive context bloat and causes attention drift (agents ignore critical instructions).
  2. The RAG Blindspot: Dumping behavioral rules into vector databases fails because agents never semantically search for operational constraints (e.g. formatting or security rules) during general tasks.

OKF Agent Memory resolves this dilemma with the Dual-Memory Agent Architecture (DMAA):

…

The Universal Composition Model

In DMAA, every agent configuration is structured by a universal composition:

$$\text{AGENTS.md} = \underbrace{\text{Domain Codex (AAG)}}{\text{Project Invariants, Tone, Guardrails}} + \underbrace{\text{OKF Memory Bridge}}{\text{Standardized Triggers: Search-Before-Write}}$$

  • Layer 1: Normative Working Memory (Push Layer): A permanent, ultra-compact behavioral codex (~100–150 tokens) expressed in Agent Action Grammar (AAG). Loaded at session start, enforcing zero-tolerance invariants.
  • Layer 2: Semantic Domain Memory (Pull Layer): An OKF v0.2 knowledge bundle (knowledge/) that consumes 0 tokens at baseline and is queried on-demand in microseconds.
mermaid
flowchart TD
    L1["1. OKF v0.2 Specification
(Normative Markdown & YAML Format)"]
    L2["2. Agent Memory Convention & DMAA
(Dual-Memory Model, Search-Before-Write, Trust)"]
    L3["3. Agent Skill & AAG Codex
(Agent Action Grammar, Workflows, Triggers)"]
    L4["4. Tooling Layer: Go Library & CLI
(Deterministic Parsing, Validation, BM25, MCP)"]
    L5["5. Project Knowledge Corpus
(knowledge/ OKF Bundle)"]

    L1 --> L2
    L2 --> L3
    L3 --> L4
    L4 --> L5

⚡ Key Highlights

  • Dual-Memory Cognitive Architecture (DMAA): Separates normative push working memory (AGENTS.md codex) from semantic pull domain memory (knowledge/ bundle), completely eliminating prompt bloat.
  • Agent Action Grammar (AAG): Ultra-compact, deterministic ASCII micro-syntax saving ~78–85% tokens compared to natural language prompt instructions.
  • **Blazing Fast Performance ( [!TIP]

Reproduce Locally with your own LLM: We provide an automated benchmark runner in pure Go to verify Time-To-First-Token (TTFT) speedups and -80% token reduction on your local hardware (LM Studio / Ollama with Gemma, Qwen, Llama). Run make benchmark or explore the Progressive Disclosure Benchmark Suite.


Quickstart

1. Build the Tooling

Clone the repository and compile the standalone okf executable:

bash
make build

This generates the standalone binary at bin/okf.

2. Basic CLI Commands

…

3. Bootstrapping Agent Memory in Any Project

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

bash
# 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:

bash
./bin/okf mcp knowledge

Example MCP Configuration (claude_desktop_config.json or Cursor):

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

Repository Structure

…

Testing & Verification

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

bash
make check

Further Documentation

  • Documentation Index — Central directory of all project documentation.
  • Getting Started Guide — Comprehensive onboarding guide for agents and humans.
  • CLI & MCP Reference — Complete command-line and protocol tools reference.
  • Dual-Memory Agent Architecture RFC — Cognitive 2-layer agent memory model (Push codex + Pull knowledge).
  • Agent Action Grammar RFC — Deterministic, token-efficient AAG micro-syntax specification for AGENTS.md.
  • Agent Instruction Best Practices — Guide to deterministic instruction design and token optimization.
  • OKF Agent Memory Convention v0.1 — Behavioral rules and lifecycle specification.
  • Contributing Guide — Development setup, quality gates, and pull request standards.
  • Security & Privacy Guidelines — Data governance, secret prevention, and PII protection rules.
  • Multi-Agent Testing & Evaluation — Test scenarios, compatibility matrix, and benchmarks.
  • Project Roadmap & Milestones — Phased development plan.
  • Release Playbook — Versioning, CI/CD pipeline, and distribution procedures.
  • Release Notes & History — Versioned changelogs and historical release notes archive.
  • OKF v0.2 Compatibility Matrix — Specification validation analysis.
  • Why OKF Agent Memory? — Detailed value proposition & differentiators.
  • Alternatives & Ecosystem Comparison — Comparison with Mem0, Letta, and ad-hoc markdown files.

Contributors

Thank you to all the wonderful contributors who have helped build and refine OKF Agent Memory!

Contributions of all kinds are warmly welcomed! See CONTRIBUTING.md and CONTRIBUTORS.md for details.


Support & Sponsoring

If you find OKF Agent Memory valuable for your autonomous agent workflows, consider sponsoring the project on GitHub to help support continuous development, security hardening, and spec compliance!


License

MIT License. See LICENSE for details.

Issues· 3 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

agent-memoryai-agentsbm25

No comments yet. Be the first to share.

> Details

PublishedSep 9, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingFree

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.