A comprehensive 2-hour workshop on building AI agents from scratch, covering fundamental concepts and practical implementations using both custom code and LangGraph.
This workshop teaches you how to build intelligent agents that can reason, plan, and take actions to solve complex problems. You'll learn two approaches:
- Building from Scratch: Understand the ReAct (Reasoning + Acting) pattern by implementing a simple agent
- Using LangGraph: Leverage powerful frameworks to build more sophisticated agents
By the end of this workshop, you will:
- ✅ Understand the core concepts of AI agents and the ReAct pattern
- ✅ Build a simple agent from scratch using OpenAI's API
- ✅ Implement action loops and tool integration
- ✅ Use LangGraph to create more advanced agent architectures
- ✅ Handle real-world scenarios like web search and multi-step reasoning
- Basic Python programming knowledge
- Familiarity with APIs and HTTP requests
- Basic understanding of Large Language Models (LLMs)
git clone <your-repo-url>
cd building-agent-workshoppython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txt-
Copy the example environment file:
cp env.example .env
-
Edit
.envand add your API keys:OPENAI_API_KEY=your_openai_api_key_here TAVILY_API_KEY=your_tavily_api_key_here
- Visit OpenAI API
- Create an account and generate an API key
- Add credits to your account (minimum $5 recommended)
- Visit Tavily
- Sign up and get your free API key
- Free tier includes 1000 searches/month
jupyter notebookFile: notebooks/01_agent_from_scratch.ipynb
Learn the fundamentals by building a ReAct agent from scratch:
- Understanding the ReAct pattern (Reasoning + Acting)
- Building a basic Agent class
- Implementing tool functions (calculator, dog weight lookup)
- Creating action loops and observation handling
File: notebooks/02_agent_using_langgraph.ipynb
Build sophisticated agents using the LangGraph framework:
- Introduction to LangGraph components
- StateGraph and node management
- Tool binding and function calling
- Real-world web search integration
| Time | Activity | Duration |
|---|---|---|
| 0:00-0:10 | Setup & Introduction | 10 min |
| 0:10-1:10 | Lesson 1: Agent from Scratch | 60 min |
| 1:10-1:20 | Break | 10 min |
| 1:20-2:20 | Lesson 2: LangGraph Agents | 60 min |
-
API Key Errors
- Ensure your
.envfile is in the project root - Check that API keys are valid and have sufficient credits
- Restart Jupyter after adding environment variables
- Ensure your
-
Package Installation Issues
- Use a fresh virtual environment
- Upgrade pip:
pip install --upgrade pip - Install packages one by one if bulk install fails
-
Notebook Not Starting
- Ensure virtual environment is activated
- Try:
python -m jupyter notebook - Check if port 8888 is available
Happy Building! 🚀