Skip to main content

llm-wiki Architecture

Chart 1 — System Overview


Chart 2 — Knowledge Ingestion Pipeline


Chart 3 — Retrieval Stack


Chart 4 — Council System

Voice B is a Pi subprocess — pi -p --no-session produces clean stdout. opencode run also writes response to stdout but with a 3-line ANSI header; strip it with:
Quick council (no council.py):
Provider status (validated):
  • openai-codex/ via Pi → ✅ clean stdout (ChatGPT Team subscription)
  • github-copilot/gpt-5.2-codex via opencode run → ✅ filterable stdout (Copilot subscription)
  • github-copilot/claude-sonnet-4.5 via opencode run → ❌ model_not_supported (Claude via Copilot unsupported in run mode)
  • opencode/ via Pi → ⏳ add payment method at opencode.ai/workspace billing to unlock

Chart 5 — Config Distribution (Source of Truth)


Chart 6 — Hooks / Automation

Hook enforcement layer (deterministic — shell exit code, not model reasoning):
  • exit 2 = block the tool call entirely (bash safety, agent whitelist, lint protection)
  • exit 0 = allow, with optional stdout message to model context (judge reminder, lint report)
  • Stop hook fires at end of every turn regardless of tool calls

Chart 7 — Agent Fleet

Roster as of 2026-10-16, checked against ~/dotfiles/claude/.claude/agents/ (only scout and worker exist) and the global rules model-routing.md and plan-handoff.md. An earlier version of this chart showed a larger fleet (agent-delegator, code-writer, code-reviewer, architecture-reviewer, security-auditor and others); none of those are installed. Define a custom agent only when a repeated job justifies its own prompt and tool limits. Pi runs outside Claude Code’s subagent system, in two roles: implementation dispatched through pueue after a plan is approved, and the advisory council subprocess. In both it is a separate process and does not share Claude Code’s hooks or skill-invocation contract. The full step-by-step flow, with human gates marked, is in Workflows. The unattended alternative for new repos, where a Haiku worker builds inside Claude and Opus reviews the diff, is send-it.

Chart 8 — Tiered Knowledge Delivery (Push / Hook / Pull)

The retrieval stack in Chart 3 is the pull tier only. It’s one third of the model that makes this repo “agent-first”: full detail in Tiered Knowledge Delivery (Push / Hook / Pull). Promotion between tiers: frequency × cost-of-violation, decided 2026-06-12 by a 4-lens agent council audit (docs/wiki-dual-use-audit-2026-06.md). Hard constraint: Tier 2 stays the default — nothing large gets pushed into Tier 0 (the 32KB wiki-index-at-startup removal, which reclaimed ~8,400 tokens/session, stands as the reference case for what NOT to push).

Linked pages