What are AI Agents?

AI Agents are autonomous systems that can perceive their environment, make decisions, and take actions to achieve goals. Unlike simple chatbots, agents can use tools, plan multi-step workflows, and adapt to changing situations.

Key Difference: Chatbot responds to prompts. Agent pursues goals autonomously using available tools.

Agent Components

Brain (LLM)

The reasoning engine. Decides what to do next based on observations and goals.

Tools

Functions the agent can call: search, calculator, API calls, code execution, etc.

Memory

Short-term (conversation) and long-term (vector DB) memory for context.

Planning

Ability to break down complex tasks into sub-tasks and execute them.

Agent Loop

1. Observe: Get current state/user input
2. Think: Reason about what to do (LLM)
3. Act: Use a tool or respond
4. Observe: See result of action
5. Repeat until goal achieved

Simple Agent Example

Conceptual agent that can use a calculator tool.

python
Output:
Click "Run Code" to see output

Types of Agents

  • ReAct Agents: Reason and Act in interleaved steps
  • Plan-and-Execute: Plan entire workflow upfront, then execute
  • Reflexion Agents: Self-reflect on failures and improve
  • Multi-Agent Systems: Multiple specialized agents collaborate

Popular Frameworks

LangChain

Most popular. Rich ecosystem of tools and integrations.

AutoGPT

Autonomous agent that can work towards goals independently.

CrewAI

Multi-agent orchestration with role-based collaboration.