A comprehensive workshop demonstrating the evolution from simple AI responses to complex agent workflows using LangChain, LangGraph, and MCP (Model Context Protocol) servers.
This repository contains a progressive series of examples showcasing:
- Basic AI agent responses
- Tool integration with agents
- MCP server architecture
- Manual graph construction with LangGraph
- Interactive workflows with user permissions
- Multi-server deployments
- Python 3.12+
- uv package manager
- OpenAI API key
- Clone and navigate to the repository
cd 08_nerdearla- Set up environment variables
cp .env.example .env
# Edit .env and add your OpenAI API key- Install dependencies
uv sync- Initialize the database
cd 00_tables_creation
# Run the SQL commands from init_db.sql to create data.db in the parent folder
cd ..Location: 00_tables_creation/
Sets up SQLite database with sample sales data for the workshop examples.
Files:
init_db.sql- Database schema and sample data
Location: 01_simple_response/
Basic implementation of an AI agent that can query a database and provide simple responses.
Run:
cd 01_simple_response
uv run main.pyExample queries:
- "Give me the sales grouped by genre"
- "Give me the total sales grouped by item category"
Location: 02_react_agent_with_tools/
Introduction to ReAct (Reasoning + Acting) agents with tool calling capabilities. Note: This implementation doesn't have memory between interactions.
Run:
cd 02_react_agent_with_tools
uv run gradio_interface.pyFeatures:
- Gradio web interface
- Synchronous and asynchronous response modes
- Database query tools
Location: 03_mcp_tools/
Demonstrates Model Context Protocol (MCP) server architecture for tool isolation and modularity.
Run:
cd 03_mcp_tools
# Start MCP server
uv run tool_mcp.py
# In another terminal, start the interface
uv run gradio_interface.pyBenefits:
- Tool isolation
- Modular architecture
- Same frontend interface
Location: 04_langgraph_manual_graph/
Manual construction of ReAct agents using LangGraph instead of built-in functions, providing more control over the agent workflow.
Implementations:
01_agent_simple_decoupled.py- Decoupled MCP connection01_agent_simple.py- Standard implementationdecoupled_yield.py- Yield-based approach
Run with LangGraph Studio:
cd 04_langgraph_manual_graph
uv run langgraph devFeatures:
- Visual graph execution monitoring
- Custom agent compilation
- Multiple MCP connection patterns
Location: 05_graph_with_pause/
Enhanced workflow with user permission system - the agent asks for permission before executing tools.
Run:
cd 05_graph_with_pause
uv run gradio_interface.pyFeatures:
- Interactive tool execution approval
- User feedback integration
- Custom checkpoint management
LangGraph Studio:
# Comment the checkpointer line in agent.py first
uv run langgraph devLocation: 06_langgraph_with_multiple_servers/
Demonstrates deployment of multiple specialized MCP servers for different capabilities.
Available Servers:
- Image Analysis - JPG image processing
- GitHub Integration - Repository interactions
- Database Tools - SQL query capabilities
Use Cases:
- Analyze data from images
- Fix GitHub issues automatically
- Extract database insights
Exercise: Implement simultaneous connection to multiple MCP servers using AsyncExitStack from contextlib.
Location: 00_images/
Contains workshop screenshots and visual documentation.
- Start with basics (01) - Understand simple AI responses
- Add complexity (02) - Learn ReAct patterns and tools
- Introduce MCP (03) - Understand server architecture
- Manual control (04) - Build custom LangGraph workflows
- Interactive flows (05) - Add user decision points
- Scale up (06) - Deploy multiple specialized servers
- LangChain: Framework for building applications with LLMs
- LangGraph: Library for building stateful, multi-actor applications
- MCP (Model Context Protocol): Standard for connecting AI models to external tools
- Gradio: Web interface for machine learning applications
- SQLite: Lightweight database for examples
Date: March 23, 2025 Time: 11:50 AM - 1:00 PM (1 hour 10 minutes) Format: Online workshop with live coding demonstrations
🎥 Watch the Workshop: YouTube Live Stream
This workshop is designed for educational purposes. Feel free to experiment with the examples and extend them for your own learning.
Educational content for NerdearLA 2025 workshop.