<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng" -->

---
title: The Agentic Loop: Three loops in a trench coat | daily.dev
description: Agent loops are more complex than they appear — they consist of three distinct loops working together. The Inference Loop handles chat completion API calls,...
canonical: https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Agentic Loop: Three loops in a trench coat | daily.dev
og:description: Agent loops are more complex than they appear — they consist of three distinct loops working together. The Inference Loop handles chat completion API calls,...
og:url: https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng
og:image: https://api.daily.dev/og/posts/JG81MlTnG.png
og:image:alt: The Agentic Loop: Three loops in a trench coat
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Agentic Loop: Three loops in a trench coat

**[Hacker News](https://daily.dev/sources/hn)** · 7 min read · 0 upvotes · 0 comments

## Summary

Agent loops are more complex than they appear — they consist of three distinct loops working together. The Inference Loop handles chat completion API calls, manages conversation history, and delegates tool usage. The Tool Loop executes the tools an LLM requests, handling hallucinated tool names, tool call IDs, and error states. The Human Loop (also called the Safety or Sanity Loop) introduces human approval or denial of tool calls before execution, which is the hardest to implement due to blocking, server restarts, and scale concerns. Together, these three loops form the foundation of agentic systems used in RAG, progressive discovery, and automated approval workflows.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.bobbytables.io/p/the-agentic-loop-three-loops-in-a>

## Similar posts on daily.dev

- [The Agent Loop: How AI Goes From Answering Questions to Doing Things](https://daily.dev/posts/the-agent-loop-how-ai-goes-from-answering-questions-to-doing-things-5vyyqtwve) · ByteByteGo · 2 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents)

[View this post on daily.dev](https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Agentic Loop: Three loops in a trench coat","url":"https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng"},"datePublished":"2026-07-14T19:55:18.705Z","dateModified":"2026-07-14T20:08:51.286Z","description":"Agent loops are more complex than they appear — they consist of three distinct loops working together. The Inference Loop handles chat completion API calls,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b6c807003684c81249f5597ccaf29b24?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b6c807003684c81249f5597ccaf29b24?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-agentic-loop-three-loops-in-a-trench-coat-jg81mltng","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"The Agentic Loop: Three loops in a trench coat"}]}
```

