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

# Introduction to AI Agents

> Learn key agentic concepts and prepare to build actual AI agents in LangGraph

Now that you have mastered the basics of building stateful graphs with static routes, conditional edges, and looping structures, it is time to build actual **AI Agents**.

In this section, we transition from pre-defined workflows to dynamic, autonomous systems where the LLM behaves as a central routing brain.

## What is an AI Agent?

Unlike a basic pipeline or hardcoded graph that follows a strict flow of steps, an **AI Agent** uses a large language model (LLM) to determine its own execution path.

The agent is given:

1. **A Goal**: A task to complete (e.g., "Analyze the tech sector's performance and draft an email summary").
2. **Tools**: A set of executable functions it can call (e.g., a PDF retriever, calculator, or email saver).
3. **Memory**: The history of what it has done so far.

Based on the goal and current history, the LLM decides which tool to call next, reviews the tool's result, and repeats the loop until it achieves the goal.

## Key Components of an Agent

To build a fully functional AI agent, we combine four core components:

* **LLM Brain**: The decision maker that evaluates inputs and decides on actions.
* **Agent State (Memory)**: Persisted message history that ensures the agent remembers past actions and user responses.
* **Tools**: Functions that allow the agent to interact with databases, APIs, or files.
* **Routing Loop**: Conditional edges that examine the LLM's response. If the LLM requests a tool call, the graph routes execution to the tool node; if the LLM has finished its task, the graph exits (`END`).

## Preparing to Build Actual Agents

In the next sections, we will build four distinct agent architectures step-by-step:

1. **Simple Bot**: A stateless assistant executing single-turn queries.
2. **Chat Bot**: A stateful assistant that maintains conversation memory over multiple turns.
3. **ReAct Agent**: A reasoning-and-action loop that dynamically selects and executes mathematical tools.
4. **Multi-Agent RAG**: A sophisticated retrieval agent that coordinates query routing across document store tools.
