Inspiration

I'm a Japanese exchange student in Spain, learning Spanish through English. I look words up every day and forget them. Translation apps help in the moment, but their history just scrolls away; vocabulary books are too slow to use in a shop or a conversation; chatbots need a prompt every time and never organise anything.

What it does

  • Tap and speak (or type). English → Spanish is filed as Couldn't say (a speaking gap), Spanish → English as Didn't catch (a listening gap). The direction is decided by code from the detected language.
  • Capture Agent checks the wordbook for the same or a similar entry, then saves it or counts it again. On the 3rd lookup the word becomes a weak word and the Capture Agent hands it over to the Tutor Agent. For sentences it proposes what to learn (a word, an expression, a grammar point) on a card; for a word with several meanings it asks which one you meant.
  • Tutor Agent writes an example sentence when it helps and decides today's review (max 7 words): which word to drop for the new one, and why. Dropping a word waits for your approval.
  • Lessons (flashcards) and a book-style Wordbook with a draggable red sheet.
  • Agent log: every tool call with agent, arguments, allowed / blocked / held, and the reason.

How we built it

  • FastAPI + vanilla JS (phone-size UI). Voice streams over a WebSocket to the Gemini Live API; the Cloud Translation API translates at once (no LLM wait).
  • Google ADK: a root agent without an LLM routes each job to the Capture Agent or the Tutor Agent (both Gemini). Gemini is called only for decisions: 2 calls per text lookup, 1 per lesson answer, 1 per background review.
  • Security: user text is wrapped as data (<user_utterance> and 7 other data tags). policy.yaml lists each agent's tools and limits, and ADK before_tool_callback checks every call: saved text must equal the input, counts only for search results, no links in examples, max 7 words in today's review, one hand-off per lookup. No agent can delete, change settings or run code.
  • A2UI-style cards: agents describe cards as JSON from a fixed catalog; the app draws them with textContent, and the server checks every button. Extracted text must be in the input sentence.
  • Human approval (approval_required in policy.yaml): dropping a word from today's review on a hand-off waits for the user's approval.
  • Audit log: every tool call (allowed, blocked or held) goes to logs/audit.jsonl and the in-app Agent log.
  • Proof: a red-team script sends 16 hijacked-agent tool calls to the real guard: 16/16 blocked. A stage script sends a fooled Gemini's requests to the running app: 2 blocked, the normal one allowed.

Challenges we ran into

Keeping the translation instant while the agents think (translation first, agents after), keeping Gemini calls to a minimum, and making the guard check arguments against facts the server owns, not just tool names.

Accomplishments that we're proud of

A complete working app built in two hours: two cooperating agents, a hand-off, human approval, and 46 passing tests.

What we learned

Least agency works: give each agent a few narrow tools and check every call against facts the server owns, and prompt injection becomes much less dangerous.

What's next for Transtudy

Photo translation, location-based grouping, AI-generated quizzes, and Cloud Run so it runs on a phone.

Built With

Share this project:

Updates

Submission history