Give coding agents git-native persistent memory

A Domain-Neutral, Git-Native Persistent Project Memory for AI Agents based on the Open Knowledge Format (OKF) v0.2. Task: 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.md or CLAUDE.md creates 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): 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 (capped at 400 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. ⚑ 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 (<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. Governance & Code-to-Knowledge Binding: Bind architecture decisions directly to source files via code_refs and query active constraints/holds via --for-path before modifying code. 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: 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: This generates the standalone binary at bin/okf. 2. Basic CLI Commands 3. Multi-Scope Memory Layering & Scoped Resolution OKF Agent Memory organises knowledge across four deterministic memory scopes. Higher layers strictly shadow identical concept IDs in lower layers during search, ensuring local project decisions always take precedence over external upstream packages or machine baselines: 4. Bundle Quality Scorecards (OpenSSF-Style) Evaluate knowledge bundles across three weighted pillars to eliminate "reproducibly wrong" context without maintenance chores: Epistemic Maintenance (35%): Invariant version-bound facts without stale_after remain 100% valid by default; penalties apply only to lapsed review deadlines or deprecated status.; tools: custom-built or unnamed agent. Human role: The original post does not say how a person stayed involved.; limitations: Prerequisites include compiling the standalone Go binary and initializing an OKF v0.2 knowledge bundle. The system relies on local BM25 indexing, so it lacks semantic understanding of complex queries compared to vector databases. Integration uncertainty exists regarding how well the 400-token codex covers all necessary project invariants without truncation. Source reliability is secondary (project README); verify security guidelines for secret prevention before use. Human approval is required for any changes to the knowledge bundle to maintain trust tiers..

Tools

custom-built or unnamed agent

Published on Agent Work Atlas:

Overview

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

Workflow

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.md or CLAUDE.md creates 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): 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 (capped at 400 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. ⚑ 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 (<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. Governance & Code-to-Knowledge Binding: Bind architecture decisions directly to source files via code_refs and query active constraints/holds via --for-path before modifying code. 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: 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: This generates the standalone binary at bin/okf. 2. Basic CLI Commands 3. Multi-Scope Memory Layering & Scoped Resolution OKF Agent Memory organises knowledge across four deterministic memory scopes. Higher layers strictly shadow identical concept IDs in lower layers during search, ensuring local project decisions always take precedence over external upstream packages or machine baselines: 4. Bundle Quality Scorecards (OpenSSF-Style) Evaluate knowledge bundles across three weighted pillars to eliminate "reproducibly wrong" context without maintenance chores: Epistemic Maintenance (35%): Invariant version-bound facts without stale_after remain 100% valid by default; penalties apply only to lapsed review deadlines or deprecated status.

Reported result

The source claims this architecture eliminates prompt bloat and reduces token usage by ~78–85% compared to natural language instructions. It asserts search latency under 300Β΅s and zero API costs for memory retrieval due to local lexical indexing. However, no independent execution logs or verified business outcomes are provided in the text. Proposed acceptance check: Run the provided Go benchmark suite to verify Time-To-First-Token (TTFT) speedups and token reduction on your specific hardware.

Human role

The original post does not say how a person stayed involved.

Limitations

Prerequisites include compiling the standalone Go binary and initializing an OKF v0.2 knowledge bundle. The system relies on local BM25 indexing, so it lacks semantic understanding of complex queries compared to vector databases. Integration uncertainty exists regarding how well the 400-token codex covers all necessary project invariants without truncation. Source reliability is secondary (project README); verify security guidelines for secret prevention before use. Human approval is required for any changes to the knowledge bundle to maintain trust tiers.

Try it

I need to set up a Git-native persistent memory system for my coding agent using OKF v0.2. 1. **Setup**: Clone the `okf-agent-memory` repository and run `make build` to generate the `bin/okf` executable. 2. **Initialize**: Run `./bin/okf bootstrap [replaceable_project_path] --name "[replaceable_project_name]"` to scaffold the `knowledge/` directory and `AGENTS.md`. 3. **Configure Codex**: Edit the generated `AGENTS.md` to include a compact 400-token behavioral codex using Agent Action Grammar (AAG) syntax. Ensure it defines project invariants and tone. 4. **Populate Memory**: Use `./bin/okf create decisions/[concept_id] knowledge --type Decision --title "[title]" --desc "[description]"` to add key architectural decisions. 5. **Verify Search**: Run `./bin/okf search "[query_term]" knowledge` to confirm the BM25 index works. 6. **Human Check**: Before finalizing, I will manually review the `git diff` of the `knowledge/` folder and the `AGENTS.md` file to ensure no secrets are exposed and the codex is accurate. 7. **Dry Run**: Execute a sample task where the agent must retrieve a decision before writing code. Show me the search query and the retrieved context. If the search returns no results or the codex exceeds 400 tokens, stop and ask for clarification on which invariants to prioritize.

Original source

Source reports are not independently verified. Publication date is the catalog publication date, not the original article date.

More cases Β· Software & development