| type | Decision | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Go Single-Binary CLI & MCP Architecture Decision | ||||||||||||||
| description | Architectural decision to implement the deterministic OKF tooling layer as a standalone Go binary with dual CLI and MCP support. | ||||||||||||||
| resource | https://github.com/okf-memory/okf-agent-memory | ||||||||||||||
| tags |
|
||||||||||||||
| generated |
|
||||||||||||||
| status | stable | ||||||||||||||
| sources |
|
The OKF Agent Memory system requires a deterministic tooling layer (Layer 4 in layers) to handle parsing, validation, search, and bundle modifications without burdening the LLM with syntax or serialization errors.
The choice of implementation technology directly affects execution speed, cross-environment portability, and friction when integrated with diverse AI agent runtimes.
- Go (Single Binary, Compiled): Zero dependencies, instant startup (<5ms), portable binary distribution, embedded MCP server.
- Python (
pip/venv): High accessibility for data/AI users, but runtime dependency overhead, virtualenv management issues, and slow CLI cold starts (100-300ms). - Node.js / TypeScript: Easy integration with web visualizers, but requires host Node/Deno runtimes.
The project adopts Go as the foundation for the okf core library, CLI, and MCP server:
- Dual-Interface Distribution: A single executable provides both standard CLI commands (
okf validate,okf search --json,okf create) and a native Model Context Protocol server viaokf mcpover stdio. - In-Memory BM25 & Graph Search: Fast lexical and structural search across frontmatter tags, descriptions, titles, and graph connections without requiring external vector databases or heavy models.
- Automated Bookkeeping:
okf createandokf updatemaintainlog.mdandindex.mdentries by default to eliminate manual bookkeeping drift, with opt-out flags (--no-log,--no-index). - Validator Trust & Stale Gating: Enforces strict trust ordering (
verified.atmust not precedegenerated.at), provides opt-in--stalegating for stale concepts, and restricts legacy checks to v0.1 format compatibility.
This decision governs Phase 3 (Go Library), Phase 4 (CLI), and Phase 5 (MCP Interface) of the roadmap/milestones.
- Bundle Isolation and Mutation Security Boundaries: Tooling layer enforces security and bundle containment boundaries