# Building AI agents from scratch vs. Frameworks

> Source: <https://promptcube3.com/en/threads/2168/>
> Published: 2026-07-23 09:01:27+00:00

# Building AI agents from scratch vs. Frameworks

Frameworks like LangChain or CrewAI are great for abstraction—handling things like conversation memory, retries, and tool execution—but they aren't doing magic. If you understand the underlying loop, you can decide if a framework is actually adding value or just adding bloat to your AI workflow.

I put together a practical tutorial in the form of a demo called "Steve," a sarcastic senior engineer agent that reviews Git diffs. Instead of using a heavy library, I built the core loop in Node.js.

The "secret" is that an agent is essentially just a loop. In my case, I used a `for`

loop instead of a `while`

loop specifically to prevent infinite loops from draining my API credits—a common headache when doing LLM agent deployment. The loop doesn't do the "thinking"; it just orchestrates the process: call the LLM, check if it wants to use a tool, execute the tool, and feed the result back to the LLM.

If you want to see how the logic actually maps out without the framework noise, check out the implementation here:

```
https://github.com/sylwia-lask/code-review-agent
```

The real hurdle isn't the orchestration code—it's the prompt engineering and choosing the right model. The loop is the easy part; getting the LLM to actually follow the tool-calling protocol reliably is where the real work happens. For those starting from scratch, I'd suggest stripping away the frameworks first to understand the request-response cycle before adding back the abstractions.

[Next AMD vs Microsoft: The New Open-Weight Power Play →](/en/threads/2155/)
