How AI Agents Work: An Architectural Deep Dive
type: NewsArticle
description: A new architectural analysis reveals that production AI agent systems are dominated by operational infrastructure rather than AI decision logic, with Claude Code's leaked source code showing only about 1.6% of its codebase constitutes AI reasoning while the remaining 98.4% handles context management, tool design, and reliability engineering. The research finds that agent architecture has converged around a small set of well-understood patterns centered on the ReAct loop—where a large language model reasons, calls external tools, observes results, and repeats—but warns that 95% of enterprise AI pilots deliver zero measurable ROI and Gartner predicts 40% of agentic AI projects will be scrapped by 2027 due to rising costs and integration complexity. The findings underscore that the field's primary bottleneck is now evaluation methodology, not model capability, as roughly half of SWE-bench-passing code changes would not be accepted by real software maintainers.
date published: 2026-05-27 08:55:17+00:00
date modified: 2026-05-27 09:17:12.103396+00:00
language: en
is accessible for free: true
article body: Post # How AI Agents Actually Work: An Architectural Deep Dive An analysis of the patterns, infrastructure, and trade-offs behind the systems that have redefined what large language models can do ## Executive Summary The term “AI agent” has become one of the most overloaded in modern tech, but at its core it refers to a simple pattern: a large language model (LLM) connected to external tools and operating in a loop where it reasons about what to do, calls a tool, observes the result, and repeats until the task is complete. This pattern, known as ReAct after the 2022 paper “Synergizing Reasoning and Acting in Language Models,” has become the foundation of every production AI agent today. What makes agents work well is not the model itself but the surrounding infrastructure: how context windows are managed across thousands of tool calls, how tools are designed for non-deterministic consumers, and how safety boundaries are enforced. A widely-circulated claim has become the defining statistic in this space: Claude Code’s leaked source code revealed only about 1.6% of its codebase constitutes AI decision logic, with the remaining 98.4% being operational infrastructure [3]. This figure is disputed: critics argue it misinterprets how the Liu et al. paper categorizes different kinds of code, and that the distinction between “AI logic” and “infrastructure” is itself an interpretive choice rather than a fact about the code. Regardless of the exact percentage, the underlying intuition holds: production agent systems are dominated by operational engineering. The architecture has evolved through several identifiable layers: **The ReAct loop**(Thought → Action → Observation) interleaves reasoning traces with external actions so the model can induce, track, and update plans while interacting with real data sources.**Tool use** connects the model to APIs, files, databases, and other systems. The key insight is that tools must be designed specifically for agents, i.e., non-determini…
publisher: Web Pulse
keywords: ai-agents, large-language-models, ai-infrastructure, ai-research, ai-tools
mentions: Claude Code
mentions: Liu et al.
citation: CreativeWork