All posts
·6 min read

What I Learned Building a Multi-Agent AI Tutor

#ai#deeptutor

DeepTutor started with a simple question: what if an AI tutor could do more than just answer questions? What if it could figure out what kind of help you actually need — whether that's a worked example, a practice problem, or just a nudge in the right direction?

I ended up building a system with four specialized agents: one for solving problems step by step, one for generating practice questions, one for doing deep research on topics, and one for guided interactive learning. Each agent is good at one thing, and there's an orchestration layer that decides which one to call.

The hardest part wasn't building any individual agent. It was the handoffs. When should the system switch from explaining to quizzing? How do you maintain context when you pass a conversation from one agent to another? I spent more time on these transition points than on the actual prompts.

One thing I didn't expect: the guided learning agent needed to be able to slow down. My first version just barreled through material. But real tutoring is about reading the room — if someone's confused, you don't keep going, you back up and try a different angle. Getting the model to do that required a lot of iteration on how I structured the feedback loop.

The RAG pipeline was another rabbit hole. I'm using it to ground the agents in actual course content, so they're not just making things up. The challenge is retrieval quality — if you pull the wrong chunks, the agent gives a confident but wrong explanation. I ended up spending a lot of time on chunking strategy and retrieval ranking.

If I were starting over, I'd build one agent first and get it really good before adding more. I tried to do all four at once and ended up with four mediocre agents instead of one great one. The orchestration complexity also grows faster than you'd think — it's not linear, it's combinatorial.

The stack is Python/FastAPI on the backend and Next.js on the frontend. Docker for deployment. It's working well enough that I actually use it myself to learn things, which is usually a good sign.

Thanks for reading. If this resonated with you, I'd love to hear from you.