AI Agents

AI agents are LLM-powered systems that can autonomously plan, use tools, and take multi-step actions to complete complex goals. Unlike a simple chatbot, an agent can browse the web, write and execute code, call APIs, and adapt its approach based on intermediate results.

What are AI Agents?

An AI agent is a system in which an LLM acts as the reasoning engine, deciding what actions to take to achieve a user-specified goal. Unlike a single-turn chat interaction, agents operate in a plan → act → observe → adapt loop, using tools to interact with external systems.

Core Agent Components

  • LLM (the "brain") — Plans actions, interprets results, decides next steps.
  • Tools — Functions the LLM can call: web search, code execution, APIs, file system, database queries.
  • Memory — Short-term (conversation context) and long-term (vector store of past interactions).
  • Orchestration — The loop that feeds tool outputs back to the LLM as context.

Agent Architectures

  • ReAct (Reason + Act) — The LLM alternates between reasoning steps and tool calls.
  • Plan-and-Execute — First plan all steps, then execute them sequentially.
  • Multi-agent — Multiple specialised agents collaborate, each with a defined role.
  • Self-refine — The agent critiques and revises its own outputs iteratively.

Popular Agent Frameworks

  • LangChain / LangGraph — Most mature ecosystem; LangGraph for stateful multi-agent flows.
  • CrewAI — Role-based multi-agent orchestration with a clean API.
  • AutoGen (Microsoft) — Multi-agent with built-in code execution.
  • LlamaIndex Workflows — Event-driven agent workflows with strong document capabilities.

Challenges

Agents introduce reliability challenges: they can take wrong actions, get stuck in loops, and are hard to debug. Robust agents need careful tool design, validation layers, and human-in-the-loop checkpoints for high-stakes tasks.

Example

A coding agent given the task 'add a login page to my app' plans the steps (analyse existing code, design the page, write the component, write tests, update routing), executes each step using a code editor tool, runs the tests, and iterates until all tests pass — without a human intervening.

Related terms

  • LLM (Large Language Model) A Large Language Model is a neural network trained on massive text corpora to predict and generate text. LLMs like GPT-4, Claude, and Gemini exhibit broad language understanding, reasoning, and generation capabilities that emerge from scale.
  • Function Calling (Tool Use) Function calling allows LLMs to output structured calls to external functions or APIs instead of free-text responses. The model selects the appropriate function, fills in parameters from the user's request, and returns a structured JSON payload that your code can execute.
  • RAG (Retrieval-Augmented Generation) RAG is a technique that combines an LLM with an external knowledge retrieval system. Instead of relying solely on its training data, the model retrieves relevant documents at query time and uses them as context to generate more accurate, up-to-date responses.
  • Transformer The Transformer is a neural network architecture introduced by Google in 2017 that uses self-attention to process sequences in parallel. It is the foundation of virtually all modern large language models, including GPT, Claude, Gemini, and LLaMA.