Skip to content

K0maru Agent MemoryLong-Term Memory Hub for AI Coding Agents

Single static binary · Zero-daemon · Transparently mounts Markdown notes and local LLM-Wikis

k0maru-agent-memory — zshv1.0.0 · 3.6 MB rust static binary
bash
curl -fsSL https://raw.githubusercontent.com/K0maru/k0maru-agent-memory/main/install.sh | bash
k0maru init --install
k0maru guard check --diff

K0maru Agent Memory

K0maru Agent Memory is a single-static-binary (3.6 MB pure Rust), zero-daemon long-term memory hub and Living ADR (Architecture Decision Record) sentinel for AI coding agents including Claude Code, Cursor, Windsurf, and Gemini CLI. It compiles local Markdown wikis into sub-300-token diff-aware context loadouts in 15 ms and enforces architectural invariants in under 10 ms.

What is K0maru Agent Memory and how does it work?

K0maru Agent Memory operates as an ultra-fast, local-first long-term memory hub that couples local Markdown wikis directly to agent execution contexts without cloud lock-in or resident daemon processes. When an AI coding agent boots, K0maru executes in 3.4 ms to inspect file system modifications via xxh3 hashing, synchronizing notes into a disposable SQLite cache. Through hybrid Reciprocal Rank Fusion (RRF k=60) combining BM25 full-text indexing, ONNX dense vector embeddings, and 1-hop WikiLinks graph boosts, it synthesizes a change-aware context loadout under 300 tokens in 15 ms. Tested on NVIDIA A100 80GB, this structural context eliminates prompt bloat, raising Qwen2.5-Coder-32B Pass@1 to 100% while cutting trajectory latency by 82.6% over flat naive chunking (IBM STAIR arXiv:2609.03874).

How does K0maru Agent Memory compare to Mem0, Zep, and ai-memory?

K0maru Agent Memory is designed specifically for deterministic codebase governance and zero runtime overhead, contrasting sharply with cloud-hosted, conversational memory platforms.

DimensionK0maru Agent MemoryMem0Zepai-memory
ArchitectureSingle static binary (3.6 MB pure Rust)Python client / Cloud serviceGo server / Cloud SaaSNode.js / Python daemon
Daemon Overhead0 resident daemons, 0 MB idle RAMCloud network dependencyDocker container or cloudPersistent background daemon
Cold Start3.4 ms CLI / 15 ms loadout180–450 ms API latency120–300 ms API latency80–200 ms runtime
Source of TruthLocal Markdown vault (BYOM)Cloud vector databaseCloud temporal graphLocal JSON / SQLite
Rule GuardrailsLiving ADR sentinel (<10 ms check)None (statistical recall only)None (dialogue graphs)None
Token Reduction86.5% Context GC / 99.4% log offloadVariable (summarization)Variable (lossy pruning)None

Unlike general conversation stores, K0maru stores knowledge in human-readable Markdown notes, using SQLite purely as a disposable accelerator. By avoiding Docker containers, remote servers, and background memory bloat, K0maru provides sub-10 ms deterministic enforcement, documented at GitHub.

How does the Living ADR Guard prevent coding agents from violating architectural rules?

The Living ADR Guard acts as an in-process sentinel that audits Git diffs against active Architecture Decision Records (ADR) in under 10 ms. Instead of relying on passive system prompts that LLMs frequently forget during long sessions, K0maru parses YAML frontmatter invariants such as deny: "SELECT * FROM" or deny: "unwrap()" directly from Markdown ADR cards. When an agent stages changes or triggers a pre-commit check, k0maru guard check --diff cross-references modified AST ranges against active invariant patterns. If a violation occurs, K0maru returns a blocking exit code 1 with exact file lines, remediation instructions, and links to the governing ADR note, achieving 100% adherence and preventing drift across multi-agent workflows.

How does deterministic ADR supersession solve belief entrenchment in coding agents?

Deterministic ADR supersession eliminates belief entrenchment by invalidating obsolete architectural guidelines whenever a superseding decision note is recorded. Large language models inherently struggle with recency conflicts when encountering contradictory rules across disparate project files. K0maru resolves this through explicit supersedes: [[ADR-004-OldAuth]] frontmatter metadata and 1-hop directional graph traversals. When an agent queries project loadouts or searches memory, K0maru's index engine traverses the WikiLinks graph, immediately pruning superseded rules from the active candidate set. As proven in the IBM STAIR benchmark (arXiv:2609.03874), graph-aware hierarchical retrieval yields an 82.6% retrieval precision versus 68.7% for flat chunking, guaranteeing that coding agents operate strictly upon the latest validated architectural consensus without hallucinating legacy conventions.

How do I install K0maru Agent Memory in Claude Code, Cursor, and Windsurf in 30 seconds?

You can install K0maru Agent Memory in under 30 seconds using a single command that downloads the 3.6 MB static Rust binary and configures your local environment. Running curl -fsSL https://raw.githubusercontent.com/K0maru/k0maru-agent-memory/main/install.sh | bash installs k0maru to your system path. Next, executing k0maru install --vault ~/Documents/MyVault performs safe, non-destructive JSON merges into configuration files for Claude Code, Cursor, Windsurf, Gemini CLI, and Oh My Pi (omp). The integration leverages the official Model Context Protocol (FastMCP) over standard stdio, allowing agents to invoke tools like get_project_loadout and recall_memory autonomously. Running k0maru doctor verifies your cache and MCP registration, completing onboarding with zero background daemons and zero Docker setup.

About K0maru Agent Memory & Contact

K0maru Agent Memory is maintained by open-source systems engineers and agent architects dedicated to zero-overhead local intelligence governance.

Released under the MIT License.