Dive into the elusive world of AI Agents and learn how to build them! There are so many frameworks, models, and practices to build them and the entire field is just getting started. In this workshop, we'll be building an agent to scrape and standardize data through a natural language interface.
Rye is not a necesary dependency but does make it much simpler. You can still create a virtual environment and install using the
requirements.lock
file
This project uses Rye for dependency management. Follow these steps to set up the project:
Instructions for installation on windows are on the Rye site
-
Install Rye if you haven't already:
curl -sSf https://rye-up.com/get | bash
-
Clone the repository:
git clone https://github.com/parthsareen/fantastic-agents-and-how-to-build-them.git cd fantastic-agents-and-how-to-build-them
-
Install dependencies using Rye:
rye sync
This will create a virtual environment and install all the required dependencies specified in the pyproject.toml
file.
- Activate the virtual environment:
. .venv/bin/activate
To use this project, you'll need to set up an API key for one of the following services:
- Sign up for an account at OpenAI.
- Navigate to the API keys page.
- Create a new secret key.
- Set the API key as an environment variable:
export OPENAI_API_KEY='your-api-key-here'
- Sign up for an account at Groq.
- Navigate to the API keys section in your account settings.
- Generate a new API key.
- Set the API key as an environment variable:
export GROQ_API_KEY='your-api-key-here'
If you prefer to run models locally:
- Install Ollama by following the instructions on the Ollama website.
- Pull the desired model:
ollama pull llama3.1
- No API key is required for Ollama, as it runs locally on your machine.
Choose the option that best suits your needs and ensure you have the necessary API key or local setup before proceeding with the workshop.
To use Browserbase for web scraping and data processing, follow these steps:
- Visit Browserbase and sign up for an account.
- Once logged in, navigate to the settings page to find your API key.
- Set the API key as an environment variable:
export BROWSERBASE_API_KEY='your-api-key-here'
- Use code
DEVTOOLS
for 1 free month - recommended if using browserbase for hackathon project.
- Setup Tavily - A searching tool for agents
- Not neccessary for workshop but recommend for projects!
Now you're ready to start working on the project!
Source code and further reading: DAGent GitHub repository.
If you find yourself stuck or running short on time, you can refer to the finished versions of the examples:
- Simple AI Agent: simple_example_finished.py
- Complex AI Agent: data_analysis_agent_finished.py
-
These files contain the complete implementations of the agents we'll be building during the workshop. While it's recommended to work through the exercises on your own, these resources are available if you need additional guidance or want to compare your solution.
-
There may be issues with some code, you might run into weird errors - best way to debug is to look at the source code and comparing against example code.
After this workshop, you will be able to:
- Conceptually understand the key components of AI Agents
- Learn why agents are so powerful
- Build an AI agent to scrape and standardize data
- Familiarity with Python
- Using pip to manage dependencies
Time | Module | Description |
---|---|---|
10 min | What are Agents | Learn what AI agents are, their anatomy, and why they're powerful |
10 min | Environment Setup | Learn how to setup and manage a Python environment for this project |
15 min | Simple AI Agent | We'll learn the basics of DAGent and build a simple AI agent |
30 min | Complex AI Agent | Build a complex AI Agent to process more data and interface with natural language |
Parth Sareen parth@extensible.dev