Tracking epic for the agent migration — retire services/gemini_service.py as the primary LLM seam in favor of Pydantic AI agents (backend/agents/). Owner: Jack (Darkest-Teddy). Roadmap milestone: end of July — gemini_service retired as primary LLM seam.
Where we actually are
Most agents already exist and are wired: classifier, summary, concepts, syllabus, quiz, chat_tutor, note_summary/concepts/chat — with model slots in agents/_providers.py and apply_graph_update_tool already a tool. What remains is migrating the last raw call_gemini* callers and the later-phase tutor/quality work, then deleting the seam.
Remaining gemini_service call sites (the work)
Issues
Build order
143 → 144/145/146/147 (parallel feature surfaces) → 148 (eval harness, ideally alongside) → 151 (cutover). 149 and 150 are the Aug/Sep depth work and can run in parallel.
Coordination
Platform hardening
Deferred (not filed): cross-provider model fallback (FallbackModel) — revisit if Gemini reliability/cost becomes a constraint.
Tracking epic for the agent migration — retire
services/gemini_service.pyas the primary LLM seam in favor of Pydantic AI agents (backend/agents/). Owner: Jack (Darkest-Teddy). Roadmap milestone: end of July — gemini_service retired as primary LLM seam.Where we actually are
Most agents already exist and are wired:
classifier,summary,concepts,syllabus,quiz,chat_tutor,note_summary/concepts/chat— with model slots inagents/_providers.pyandapply_graph_update_toolalready a tool. What remains is migrating the last rawcall_gemini*callers and the later-phase tutor/quality work, then deleting the seam.Remaining
gemini_servicecall sites (the work)routes/documents.py:150,225→ [P1] Agent migration: document classify/extract step → Pydantic AI agent #143services/calendar_service.py:73→ [P2] Agent migration: calendar assignment extraction → agent #144routes/quiz.py:289,458+services/course_context_service.py:56→ [P2] Agent migration: quiz generation + course-context regen → agent #145services/flashcard_import_service.py+routes/flashcards.py→ [P2] Agent migration: flashcard generation/import → agent #146routes/study_guide.py:99,routes/social.py:127,main.py:192→ [P2] Agent migration: remaining one-shot LLM calls (study guide, social, health) → agents/seam #147routes/learn.py:417,538,847(legacy chat fallback, ADR-0001) → retired last in [P1] Agent migration: retire call_gemini* + gemini_service.py (final cutover) #151Issues
[P1][P2][P2][P2][P2][P2][P1](Aug)[P2](Sep)call_gemini*+gemini_service.py(final cutover)[P1]Build order
143 → 144/145/146/147 (parallel feature surfaces) → 148 (eval harness, ideally alongside) → 151 (cutover). 149 and 150 are the Aug/Sep depth work and can run in parallel.
Coordination
notesencrypted when migrating extraction ([P2] Agent migration: calendar assignment extraction → agent #144).Platform hardening
[P2](codifies theorchestrator-schema-complexityrule)[P2](ADR 0011; overlaps [P2] Document pipeline robustness: post-result fallback double-fire, empty-OCR persistence, blocking IO, wrong size message #132)Deferred (not filed): cross-provider model fallback (
FallbackModel) — revisit if Gemini reliability/cost becomes a constraint.