AI Living Codebase Synthesis
How OpenKB uses a read-only OpenCode agent to generate evidence-backed codebase docs.
AI Living Codebase Synthesis
OpenKB uses a read-only OpenCode research session to inspect your repository before writing Google OKF-compliant concept documents.
How It Works
1. Repository Research
OpenCode discovers and reads relevant manifests, entry points, implementation modules, tests, and configuration for each concept.
2. Read-Only Agentic Synthesis
The embedded agent can search and read the repository but cannot edit files, run shell commands, access the web, or leave the project directory.
3. Provenance Validation
Concept documents are accepted only when their YAML frontmatter is valid and every cited source path exists in the repository.
4. Agent Pointer Synchronization
OpenKB injects delimited pointers into `AGENTS.md` and `CLAUDE.md` so coding agents (Cursor, Claude Code, Copilot) automatically discover the knowledge base.
Running AI Synthesis
Set an OpenRouter API key, then execute the CLI generate command. OpenCode provides the agentic repository research interface; OpenRouter provides model access:
export OPENROUTER_API_KEY="sk-or-v1-..."
openkb generate --init
Single model-provider path
OpenKB restricts its OpenCode session to OpenRouter. This keeps credentials and model access consistent without exposing a separate OpenCode model configuration surface.
OpenKB uses DeepSeek V4 Flash for the synthesis session: a cost-efficient model selected for repository research, tool use, and long-context documentation work.