Crash Course: Building AI Agents with Open-Source Tools
This project is a hands-on crash course on building AI agents using a 100% open-source tech stack! You'll learn:
- What is an AI agent
- Connecting agents to tools
- Overview of MCP (Multi-Component Protocol)
- Replacing tools with MCP servers
- Setting up observability and tracing
All concepts are demonstrated with real, runnable code.
Watch this tutorial on YouTube
What is an AI Agent?
An AI agent uses an LLM as its brain, has memory to retain context, and can take real-world actions through tools (like browsing the web, running code, etc.).
In short: it thinks, remembers, and acts.
Tech Stack
- CrewAI — Build MCP-ready agents
- Zep Graphiti — Add human-like memory
- CometML Opik — Observability and tracing
- 100% open-source!
System Overview
Here's how the system works:
- User sends a query
- Assistant runs a web search via MCP
- Query + results go to the Memory Manager
- Memory Manager stores context in Graphiti
- Response agent crafts the final answer
SetUp
- Setup ollama:
-
Install Ollama by following the official instructions for your OS:
For macOS:
curl -fsSL https://ollama.com/install.sh | shFor Linux:
curl -fsSL https://ollama.com/install.sh | shFor Windows: Download and install from Ollama's official website
-
Pull the required model:
ollama pull llama3.2
You should see a response from the model. If you get any errors, check that Ollama is running with:
-
Add all necessary keys:
Create a new
.envfile in the project root, using.env.exampleas a template. Copy the example file and fill in your own API keys and secrets as needed.cp .env.example .env # Then edit .env to add your keys -
Install dependencies:
Run the following command in the project root to install all required dependencies:
uv sync
Start MCP servers:
-
Start Linkup server:
Run the following command in the project root:
python server.py -
Start the Graphiti MCP server:
This is only for advanced usage, you cna still learn all the fundamentals with just Linkup MCP server also.
Follow the instructions in the Graphiti MCP README
📬 Stay Updated with Our Newsletter!
Get a FREE Data Science eBook 📖 with 150+ essential lessons in Data Science when you subscribe to our newsletter! Stay in the loop with the latest tutorials, insights, and exclusive resources. Subscribe now!
Contribution
Contributions are welcome! Feel free to fork this repository and submit pull requests with your improvements.
