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 subprocesspi -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

Pi is not in the agent fleet. It is a thin subprocess called via Bash when a Codex second opinion is needed. It does not share the Claude Code hooks system, .agents/ coordination bus, or skill invocation contract.

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).