Introduction
What are Agents?
Agents are autonomous programs that use language models to achieve tasks. They solve problems by running tools, accessing knowledge and memory to improve responses.
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 agents collaborating on complex workflows.
If you haven’t built your first agent yet, 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