
为AI编码代理提供Git原生的持久内存。实现了Google OKF v0.2,内存内搜索速度低于300微秒的BM25,嵌入式MCP服务器和渐进披露。
概览
与AI代理的对话在上下文窗口关闭时重置。除非持续存储,宝贵的架构决策、域发现和运营事实都会丢失。 提供一个标准化、厂商中立的内存层,直接存储在您的仓库(knowledge/)中,作为带有 YAML 前页的纯 Markdown 文件。它弥合了非结构化临时 markdown 文件(CLAUDE.md、AGENTS.md)与复杂黑盒向量数据库之间的差距。 * :内存内的 BM25 检索和捆绑验证可在微秒内执行,无需虚拟机启动或网络往返。* :所有内容均为版本控制的纯文本。使用标准 git diff 和 git 日志检查、审计和审查您的代理内存。无需外部数据库。* :本地词汇 BM25 索引消除了重复的向量嵌入 API 成本和网络往返。* :采用开放标准格式进行代理知识,并全面支持来源(来源)、信任层级(生成与
概述(AI 翻译)
基于开放知识格式(OKF)v0.2,基于领域中立、git原生的AI代理持久项目内存。
🌟 概述
与AI代理的对话在上下文窗口关闭时重置。除非持续存储,宝贵的架构决策、域发现和运营事实都会丢失。
传统方法存在两种致命的失败模式:
- 提示单体:将所有领域知识和规则塞入
AGENTS.md或CLAUDE.md中,会导致大量上下文膨胀并造成注意力分散(代理忽视关键指令)。 - RAG盲点:将行为规则转储到向量数据库失败,因为代理在通用任务中从未语义上搜索操作约束(如格式化或安全规则)。
OKF 代理内存通过**双内存代理架构(DMAA)**解决了这一难题:
通用合成模型
在DMAA中,每个代理配置都由一个通用组合结构化:
$$\文本{特工们。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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:
- The Prompt Monolith: Stuffing all domain knowledge and rules into
AGENTS.mdorCLAUDE.mdcreates massive context bloat and causes attention drift (agents ignore critical instructions). - 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):
flowchart TD
subgraph PUSH["1. Normative Working Memory (Push Layer)"]
direction TB
C1["Canonical AGENTS.md (capped at 400 tokens)"]
C2["Domain Codex (Invariants, Ethics, Tone)"]
C3["OKF Memory Bridge (Deterministic Triggers)"]
C4["Agent Action Grammar (AAG) Micro-Syntax"]
end
subgraph PULL["2. Semantic Domain Memory (Pull Layer)"]
direction TB
O1["OKF v0.2 Knowledge Bundle (knowledge/)"]
O2["0 Tokens baseline in system prompt"]
O3["Selective Retrieval via okf_search / okf_show"]
O4["Persistent Graph of Decisions, Facts & Runbooks"]
end
INPUT["User Request"] --> PUSH
PUSH -->|Enforces Domain Codex & Triggers| AGENT["AI Agent (LLM)"]
AGENT -->|Selective Retrieval| PULL
PULL -->|Context & Facts| AGENT
AGENT --> OUTPUT["Deterministic Response"]
The Universal Composition Model
In DMAA, every agent configuration is structured by a universal composition:
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"okf-memory": {
"command": "/path/to/okf-agent-memory/bin/okf",
"args": ["mcp", "/path/to/project/knowledge"]
}
}
}