Your AI Agent is just a while loop with an API call. Let me prove it.
AI agents are everywhere right now. You can create your own with Vercel AI SDK, LangChain, Claude SDK, Google ADK etc. with ~20 lines of code.
But what actually happens inside?
What is behind that magical `generateText()` call?
How and why are tools and MCP servers called, and how does the whole flow work?
If you use it as a black box when things break, it's a matter of time before you're guessing instead of understanding.
Spoiler: there's no magic. It's a loop, a few API calls, some tool invocations, a lot of prompt-engineering glue, and even more glue.
I've been building an AI agent (with Vercel AI SDK) that helps professionals prepare for meetings by processing emails, chats, and calendars.
At some point, debugging the system was like hitting the black box with a stick and wondering why it didn't work, so I decided to open up the box.
In this talk, I'll show you:
- What actually happens during an agent's "thinking" – using real API call traces from a production system
- How tool calling and MCP integration work under the hood
- The orchestration and architecture patterns you have to take care of and be aware of
You'll walk away knowing what your agent is doing when no one is watching. No more black boxes.