ADR-0002: Coach in two tiers: an offline sparring partner on local Gemma and a zero-knowledge judge on Gemini Argon
Accepted
Status: accepted ยท 2026-10-24
Contextโ
ai-coach is the demo for a conference talk that argues against "chat with your docs" tools: they hand out summaries and stop the reader thinking. The coach must instead make the learner explain their own private notes. It must work with no network (on a train or a plane), and the notes must never leave the machine.
Decisionโ
- Tier 1, the sparring partner, runs offline on a local Gemma model served by Ollama. It reads the notes and runs a Socratic, Feynman-style dialogue (ADR-0005). The model comes from
OLLAMA_MODEL; the host defaults tohttp://127.0.0.1:11434and must be plain http on loopback, or the adapter refuses to start. - Tier 2, the judge, runs online on Gemini through
@google/genai. It never sees a note: it gets only the challenge Tier 1 asked and the learner's answer (ADR-0004), and judges them with the blind claim-extraction protocol (ADR-0006). - The judge model is
gemini-4-argonwiththinkingLevel: 'MEDIUM'(or'HIGH'). An optional fallback, for examplegemini-3.8-flash, is used only when Argon answers 429 or 5xx or cannot be reached; a 400 still fails. - Authentication is
GEMINI_API_KEYread bynew GoogleGenAI()against the Gemini Developer API; Vertex AI is switched off. - Tier 1 records a session first; Tier 2 judges it later, whenever the learner is back online.
Consequencesโ
- Sparring needs Ollama and a pulled Gemma model; judging needs network and a key.
- If
GOOGLE_API_KEYis also set, the SDK uses it instead ofGEMINI_API_KEY. - Tier 1's verdict and Tier 2's verdict are recorded separately, and mastery is derived from both (ADR-0003).