Building a Language Companion AI Agent

Published: (December 12, 2025 at 12:42 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Background

For the last few weeks I have been learning about Google’s ADK (Agent Development Kit) and working on a capstone project for the AI agents course. Coming from a front‑end background (with recent back‑end work), I wanted to explore AI agents’ UI/UX and experiment with specialized interfaces that let users accomplish tasks without switching context.

Problem Statement

I have been learning Mandarin for several years and use AI as a language companion. A major pain point is the constant need to move information between the conversation, an editor, and the browser to look up videos or additional resources. I wanted a single place where the conversation, explanations, and interactive quizzes could live together.

Initial Setup Challenges

  • Development environment – Kaggle notebooks are great for learning but feel limiting for a production‑grade project.
  • Python version differences – The ADK examples use a slightly different Python setup than the learning material, and I was unsure which tools to adopt. I introduced uvicorn and typed Python, and eventually created a Dockerfile to isolate the environment.

After a few days of wrestling with the setup, I shifted focus from perfecting the environment to refining the prompts and agent architecture.

Agent Architecture

Sub‑agents

  1. Prompt Inspector – Analyzes the user’s goal.
  2. Meaning Extractor – Determines the semantic meaning of the input.
  3. Vocabulary Retriever – Finds relevant vocabulary items.
  4. Pattern Finder – Identifies common language patterns.
  5. Summarizer – Consolidates the outputs of the previous agents.

Lessons Learned

  • Small changes in docstrings (e.g., mentioning “English language”) caused the agent to reject non‑English inputs.
  • The summarizer initially ignored the sub‑agents’ results, sometimes summarizing its own summary. Adding explicit conditionals resolved this behavior.

Interaction Flows

  1. Explain a phrase – The agent breaks down a specific sentence, providing meaning, vocabulary, and patterns.
  2. Explain a topic – The agent generates example phrases and then applies the same sub‑agents to each phrase, offering a broader contextual understanding.

Memory and State

Although the course notebooks suggested easy session and long‑term memory handling, configuring the ADK runner and session proved cumbersome. For the prototype I omitted persistent memory, focusing instead on core functionality.

Human‑in‑the‑Loop & Elicitation

I explored a human‑in‑the‑loop pattern called elicitation. To coordinate external calls, I built an MCP (Multi‑Component Protocol) server using FastMCP, which simplifies request handling. Deployment to the official cloud service is not yet supported, so I run the server locally with a streaming HTTP interface.

Quiz Generation Workflow

  1. The ADK captures conversational context and generates an MCP request.
  2. A quiz page is created, and a link is returned to the user.
  3. After the user completes the quiz, they can ask the agent to evaluate it.
  4. Answers are stored in an external database for persistence and sharing.
  5. The AI agent grades the quiz, including open‑ended questions—something difficult without LLMs.

Results

The prototype delivers an AI‑powered language tutor that can:

  • Explain phrases and topics with detailed linguistic breakdowns.
  • Generate interactive quizzes that live outside the main conversation.
  • Persist quiz results and provide AI‑based grading.

Future Work

  • Deploy the MCP server to a cloud platform for broader accessibility.
  • Implement robust session and long‑term memory handling.
  • Refine the summarizer to consistently incorporate sub‑agent outputs.
  • Expand the quiz system to support richer question types and collaborative sharing.

Conclusion

Building this language companion highlighted both the power of Google’s ADK and the convenience of FastMCP for boilerplate code. While there is still work to be done to reach production quality, the project demonstrates a viable approach to integrating conversational AI with interactive language learning tools.

Back to Blog

Related posts

Read more »