Virgil · Build article
1 September 2026 · 7 minute read
Your learning backlog should work while you do something else.
Building Virgil, an AI learning manager that turns scattered sources, commitments, feedback and results into one checked next move.
I created this article for the purposes of entering the All Things Agentic Hackathon. Virgil was conceived, designed and built during the hackathon contest period.
Final submission · 2 minutes 8 seconds
See the working loop and its Google Cloud proof
The submitted demo follows one pin from the browser into learning, evidence and a changed next move. It also shows the hosted Cloud Run endpoint, the live service and background Job, a successful health check, and verified Google ADK, Gemini and Firestore execution.
In this article
Start where curiosity happens
The learner should not have to open another empty box
You are reading about Gemma and reach the one paragraph that finally makes model routing click. The useful moment is already happening. Starting a new app, copying context and explaining why the passage matters is friction at exactly the wrong time.
Virgil stays beside you while you browse. Highlight the passage, press Pin, and keep moving. Virgil preserves the exact selection, source page and nearby context. You can learn it immediately in the side panel or return when there is time to do it properly.
A bookmark remembers where. A chat remembers what you asked. Virgil is built to remember what you encountered, what you understood and what would be useful to do next.
One connected learning loop
One Gemma pin can become a lesson, evidence and a better next move
- See it. Find a useful passage while browsing.
- Pin it. Virgil keeps the source receipt and why the passage mattered.
- Learn where it fits. Stay in the side panel, open the full Virgil page, hand the context to Gemini, use Virgil's study tools through WebMCP, or move the saved material into Google Notebook.
- Respond. Answer, correct the explanation, defer it, or record what happened in another tool.
- Get a better next move. Virgil updates the Board and prepares one useful action for the time available.
The same pin survives every surface. A correction does not disappear into chat history. A deferred lesson does not become false evidence of failure. An external outcome only changes the learner record when the learner explicitly records it.
Pin what matters. Learn it where you are. Let the result change what happens next.
The agentic work
Virgil does the heavy learning-management work while nobody is waiting
The foreground product needs to be fast. Saving a pin, asking one question or opening a short lesson should not wait for a large workflow. The deeper work belongs in a background lane.
When processing begins, a Google ADK SequentialAgent runs eleven ordered stages:
intake → forage → cluster → survey → analyse → comfort
→ statements → prospect → garden → compose → verifyThose stages take scattered sources and commitments, group related material, map prerequisites, read the learner's evidence, identify gaps, prepare teaching and verify every composed section against its sources. The result returns as one next action with a visible reason, not another list of everything the learner has not finished.
This is the autonomous value of Virgil. The learner captures what matters and remains responsible for decisions. The agent handles the slow, repetitive work of rebuilding the whole learning picture every time new evidence arrives.
Collaborative Partner
Adaptation comes from inspectable evidence, not a personality guess
Virgil asks questions when the source is ambiguous. A date that might be an exam or a suggested milestone becomes a clarification request. A course outline becomes a draft beside its exact source, and nothing enters the plan until the learner confirms it.
The feedback loop continues during learning. Answers, corrections, deferrals and outcomes update separate evidence types. The learner's own words outrank Virgil's inferred read. Completing a lesson never becomes mastery by itself.
Insights keeps that model visible. Every statement is labelled as my read or your words, carries its evidence and can be confirmed, corrected or removed. This gives the agent enough memory to adapt over time without hiding how it reached the conclusion.
Production-minded architecture
One learner state, two execution speeds, explicit Google services
| Layer | Responsibility |
|---|---|
| Chrome MV3 + full page | Capture, side-panel teaching, the Board, studies, plans, feedback and learner controls. |
| Cloud Run service | Serve the authenticated product API and fast foreground operations. |
| Cloud Run Job + Google ADK | Run the restartable eleven-stage background workflow in a deterministic order. |
| Firestore | Store learner-scoped sources, evidence, drafts, plans, checkpoints and receipts. |
| Firebase Authentication | Establish learner identity for the hosted installation without a second Virgil password. |
| Gemini 3.5 Flash-Lite | Handle fast structured cloud work through a typed model boundary. |
| Google Drive + Notebook | Maintain stable learner-facing source documents for deeper work outside Virgil. |
The fifteen named agents share typed ports for models, persistence, research, embeddings and time. Core domain code imports no provider SDK. Google adapters supply the deployment, while deterministic code owns ranking, persistence, budgets, retry identity and review.
That separation matters when something fails. A background stage can stop and resume from a checkpoint. A stale retry cannot overwrite a newer learner action. An unavailable model does not silently route work to a different paid provider.
Bonus integration, real product choice
Gemma runs fast work on the learner's own computer
Virgil also integrates Google's Gemma as an implemented local model route. The default fast local tier is gemma4:12b-mlx through Ollama. A paired connector lets an authenticated hosted installation send opted-in model work to the learner's computer.
Deep local work uses qwen3.8:27b-mlx, and image-bearing requests use qwen3-vl:8b so a text-only model is never asked to judge pixels it did not receive. Local work remains outside the Cloud/API spend boundary.
Gemma is not a silent fallback or a future promise. The learner chooses the route, Virgil shows which route answered, and the same product contract applies whether the work runs through Gemini in Google Cloud or Gemma locally.
What made the build hard
The interface, stored state and failure path all have to agree
A convincing loading state is not enough. If Virgil says model spending is stopped, the request must be refused before provider dispatch. If a course intake says draft, no deadline or commitment can become authoritative. If a lesson says source-grounded, every section must retain the source that supports it.
The hardest failures were agreement failures between a control, its receipt, the resulting page, the stored state and the recovery path. We built explicit guards around each:
- source-bound generation with independent verification and withholding;
- stable retry IDs and visible receipts for state-changing work;
- a pre-dispatch Cloud/API spend stop;
- checkpointed background stages instead of one fragile long request;
- learner confirmation before drafts become plans, commitments or signals; and
- backup and deletion that include derived state as well as raw pins.
What I learned
An agent becomes useful when its work changes the next decision
The first lesson was that background execution needs a product consequence. Eleven stages are architecture. One checked next move that changes after a learner correction is a product.
The second was that adaptation needs inspectable evidence. Virgil does not infer a permanent learning style from a profile label. It reacts to saved sources, time choices, answers, corrections, unfinished work and recorded outcomes, then lets the learner inspect and overrule the result.
The third was that autonomy and authority should be separated. Virgil can forage, group, analyse, prepare and verify while the learner is away. It still cannot decide that a proposed obligation is real, that a deadline is accepted or that a learner has mastered something. The agent does the heavy lifting. The learner keeps the truth.