Introduction
What are Agents?
Agents are intelligent programs that solve problems autonomously.
Agents have memory, domain knowledge and the ability to use tools (like searching the web, querying a database, making API calls). Unlike traditional programs that follow a predefined execution path, Agents dynamically adapt their approach based on the context and tool results.
Instead of a rigid binary definition, let’s think of Agents in terms of agency and autonomy.
- Level 0: Agents with no tools (basic inference tasks).
- Level 1: Agents with tools for autonomous task execution.
- Level 2: Agents with knowledge, combining memory and reasoning.
- Level 3: Teams of specialized agents collaborating on complex workflows.
If this is your first time building agents, follow this guide and then dive into more advanced concepts.
Example: Research Agent
Let’s create a research agent that can search the web using DuckDuckGo, scrape the top links using Newspaper4k and write a research report for us. Ideally we’ll use specialized tools (like Exa) but let’s start with the free tools first.
The description and instructions are converted to the system message and the
input is passed as the user message. Set debug_mode=True
to view logs behind
the scenes.
Create Research Agent
Create a file research_agent.py
Run the agent
Install libraries
Run the agent