What are Agents?
Agents are autonomous systems that can:- Reason about complex tasks
- Use tools to perform actions
- Make decisions based on context
- Iterate until reaching a goal
Modern Workflow-Based Agents
LlamaIndex.TS now uses an event-driven workflow architecture for agents. This provides:- Better control flow
- Easier debugging
- More flexible agent patterns
- Multi-agent orchestration
Installing the Workflow Package
Building Your First Agent
1
Define Your Tools
Tools are functions that agents can call:
2
Create the Agent
Use the
agent() helper to create a workflow-based agent:3
Run the Agent
Execute tasks and get results:
Complete Working Example
Here’s a full agent with tool usage:Multi-Agent Orchestration
Build systems with multiple specialized agents:Agent Configuration
System Prompts
Customize agent behavior:Verbose Mode
Enable detailed logging:Agent Handoffs
Define which agents can delegate to others:Creating Custom Tools
Tools use Zod schemas for type-safe parameters:Migrating from Legacy Agents
If you’re using the oldReActAgent or LLMAgent:
Next Steps
- Learn about Workflows for custom agent patterns
- Explore Query Engines as agent tools
- Build RAG-powered agents with document retrieval