← All posts

The core of an AI agent is just a loop

Many people think agents are complicated. The core is one loop:

  1. Give the model the question and current context;
  1. The model decides: answer, or call a tool;
  1. If it calls a tool → run it → feed the result back;
  1. Repeat until it gives a final answer.

That's it. Most "frameworks" just make this loop more convenient.

The fastest way to understand it is to write it yourself — you'll find the core is a few dozen lines.

Next: giving the model hands — tool calling.

Comments 0

No comments yet — be the first!

Log in Log in to comment