Article may be outdated

This article is 84 days old. Some details may have changed since publication.

Hacker News·6 min read·hard

The Agentic Loop: Three loops in a trench coat

B
btables
The Agentic Loop: Three loops in a trench coat
✦AI Summary

This technical post breaks down the architecture of 'agentic' AI systems into three distinct loops: inference, tool usage, and chat history management. It provides a conceptual framework for developers building autonomous AI agents.

Why it matters

It provides a foundational understanding of how modern AI agents are engineered to perform complex, multi-step tasks.

✦Dive DeeperCreate a free account to unlock

Agent loops are often oversimplified. They’re presented as a single loop, when really it’s three loops in a trench coat that make up an “agentic” experience for a customer. I’m here to write (yes, I wrote this, insane right?) yet-another-blog about agent loops. The example code blocks are also pseudo-code and for illustrating these ideas. Also I’ve omitted streaming, which complicates the post but the shape of these stays the same.

I even made this image! The Inference Loop The most reductive way to explain Large Language Models is that they take text, and predict the next charact... err... tokens. Unlike your ex, they really do complete your sentences. This is achieved with an inference loop.

Your inference loop has three responsibilities:

Make chat completion API calls (infer the next words)

Pass a tool usage request to your tool loop (more later)

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyai
✦

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in