
适用于 AI 编码代理的 Git 原生持久内存。实现了 Google OKF v0.2,内存访问时间小于 300µs
适用于 AI 编码代理的 Git 原生持久内存。实现了 Google OKF v0.2,内存访问时间小于 300µs
A Domain-Neutral, Git-Native Persistent Project Memory for AI Agents based on the Open Knowledge Format (OKF) v0.2.
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:
AGENTS.md or CLAUDE.md creates massive context bloat and causes attention drift (agents ignore critical instructions).OKF Agent Memory resolves this dilemma with the Dual-Memory Agent Architecture (DMAA):
…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}}$$
knowledge/) that consumes 0 tokens at baseline and is queried on-demand in microseconds.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 --> L5AGENTS.md codex) from semantic pull domain memory (knowledge/ bundle), completely eliminating prompt bloat.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 benchmarkor explore the Progressive Disclosure Benchmark Suite.
Clone the repository and compile the standalone okf executable:
make buildThis generates the standalone binary at bin/okf.
…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 guidesAGENTS.md — Project-tailored operating instructions for AI coding agentsMakefile — Convenience tasks for validation (make validate) and search (make search q="...")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 knowledgeclaude_desktop_config.json or Cursor):{
"mcpServers": {
"okf-memory": {
"command": "/path/to/okf-agent-memory/bin/okf",
"args": ["mcp", "/path/to/project/knowledge"]
}
}
}…Run the full test suite and validate the repository's self-documenting knowledge bundle:
make checkAGENTS.md.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.
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!
MIT License. See LICENSE for details.
暂无开放 Issues,或尚未同步最近议题。