Agentic AI FoundationsAIS-01 · theory

Source · Anthropic "Building Effective Agents" (2024); Yao et al. ReAct (ICLR 2023); OpenAI "A Practical Guide to Building Agents" (2025)

Why this matters

Anthropic, "Building Effective Agents" (2024)

A chatbot answers a question and stops. An agent keeps going until a goal is met: it decides what to do next, takes an action in the world, looks at the result, and decides again. That loop is what turns a language model from a text generator into something that can book a flight, refactor a codebase, or triage a support queue.

Getting the foundations right is the difference between a demo and a system. Teams that skip straight to frameworks often build brittle agents that loop forever, hallucinate tool calls, or burn tokens without converging. Understanding what an agent actually is — and when you should NOT build one — is the first real skill.

The concept

Yao et al., "ReAct: Synergizing Reasoning and Acting in Language Models" (ICLR 2023)

An agent is an LLM driving a loop over tools. Four ingredients:

1. Model — the LLM that reasons and chooses actions. 2. Tools — functions the model can call (search, run code, query a database) that give it hands in the world. 3. Memory — context carried across steps: the running transcript (short-term) plus retrieved facts or past sessions (long-term). 4. The loop — the controller that feeds tool results back to the model and repeats until a stop condition.

The canonical reasoning pattern is ReAct (Reason + Act): the model interleaves a thought, an action (tool call), and an observation (tool result), then thinks again. An alternative is plan-and-execute: the model first writes a full plan, then executes the steps, re-planning only if something breaks. ReAct is adaptive but can wander; plan-execute is cheaper and more predictable but weaker when the environment surprises it.

Worked example

Anthropic, "Building Effective Agents" — agent vs workflow distinction (2024)

Ask an agent: "What was our revenue last quarter and is it up year-over-year?"

- Thought: I need the numbers; I should query the finance database. - Action: call sql_query with a SELECT for Q-latest revenue. - Observation: returns 4.2M. - Thought: now I need the same quarter last year. - Action: call sql_query again for the prior year. - Observation: returns 3.6M. - Thought: I have both; 4.2 vs 3.6 is up ~17%. I can answer. - Final answer: "4.2M, up about 17% year-over-year."

A plain LLM would have guessed or refused. The agent grounded each claim in a real tool result — and it stopped on its own once it had enough to answer.

How it connects

Anthropic, "Building Effective Agents" (2024); OpenAI, "A Practical Guide to Building Agents" (2025)

Agents vs workflows is the load-bearing distinction. In a workflow the control flow is written by you: fixed steps, predetermined branches, LLM calls slotted into a pipeline. In an agent the LLM itself decides the control flow at runtime. Workflows are more predictable and cheaper; agents are more flexible but harder to constrain. The practical guidance: use the simplest thing that works, add agentic autonomy only when the task genuinely needs open-ended decision-making.

Autonomy levels run from a human approving every step, to human-on-the-loop (agent acts, human can interrupt), to fully autonomous. Higher autonomy raises both capability and blast radius — which is exactly why frameworks (AIS-02), safe tool use (AIS-03), and guardrails/evaluation (AIS-04) exist.

Common traps
  • Calling any LLM-plus-a-tool an "agent." If the control flow is hard-coded by you, it is a workflow — the agent label requires the model to decide the next step at runtime.
  • Reaching for an agent when a workflow would do. Open-ended autonomy costs more tokens, latency, and unpredictability; only pay it when the task truly branches unpredictably.
  • Forgetting a stop condition. An agent loop with no max-steps, no budget, and no success check will spin, repeat tool calls, or loop until it exhausts the context window.
Key takeaways
  • An agent is an LLM running a loop over tools with memory, deciding its own next action until a goal is met.
  • ReAct interleaves thought/action/observation and adapts step by step; plan-and-execute commits to a plan up front and is cheaper but less reactive.
  • The agent-vs-workflow line is about who controls the flow: the model (agent) or you (workflow). Prefer the simplest design and add autonomy deliberately.