A beginner-friendly starter template for building AI agents with Azure OpenAI. This repository demonstrates various AI agent patterns and architectures using modern Python libraries.
Learning AI agent development can be overwhelming with complex frameworks and abstract concepts. This repository takes a different approach:
- Read the code first - Each file is designed to be simple and educational
- Progressive complexity - Start with basic Azure OpenAI, then move to LangChain
- Real examples - Working code you can run and modify immediately
- No magic - Everything is transparent and easy to understand
Perfect for developers who want to understand how AI agents actually work under the hood.
- Multiple AI agent architectures and patterns
- Tool calling and external API integration
- Web search and research capabilities
- RAG (Retrieval Augmented Generation) examples
- MCP (Model Context Protocol) integration
- Async/await support for better performance
- Easy setup with Poetry dependency management
- LangChain agent with custom tools and web search (Lesson 07)
- Python 3.12+
- Azure OpenAI service access
- Poetry (for dependency management)
-
Clone the repository:
git clone https://github.com/yourusername/ai-agent-experiments.git cd ai-agent-experiments -
Install dependencies:
poetry install
-
Set up environment variables:
cp .env.template .env # Edit .env with your Azure OpenAI credentials -
Configure your Azure OpenAI settings in
.env:AZURE_OPENAI_API_KEY=your_api_key_here AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/ AZURE_OPENAI_API_VERSION=2024-02-15-preview AZURE_OPENAI_DEPLOYMENT=your_deployment_name
The best way to learn is by reading the code! Each file is designed to be simple and educational:
ai_agent_experiments/faiss_store.py- FAISS vector store for RAG implementationrag.ipynb- RAG (Retrieval Augmented Generation) Jupyter notebookai_agent_experiments/mcp_stdio_client.py- MCP stdio client implementationai_agent_experiments/mcp_streamable_client.py- MCP streamable client implementationlesson_01_basic_azure_openai.py- Basic Azure OpenAI (no LangChain)lesson_02_react_pattern.py- ReAct pattern implementation (reasoning + acting)lesson_03_langchain_basics.py- LangChain basics with Azure OpenAIlesson_04_tool_calling_mcp.py- Conversational AI with tool calling and MCPlesson_05_langgraph_advanced.py- Advanced agent workflows with LangGraphai_agent_experiments/lesson_07_langchain_agent.py- LangChain agent with custom tools and web searchmain.py- Interactive chat interface
# Start with RAG implementation (Jupyter notebook)
jupyter notebook rag.ipynb
# Explore the MCP infrastructure
# Read ai_agent_experiments/mcp_stdio_client.py
# Read ai_agent_experiments/mcp_streamable_client.py
# FAISS vector store (utility module)
# Read ai_agent_experiments/faiss_store.py to understand vector storage
# References and examples
jupyter notebook references/references.ipynb# Basic Azure OpenAI
poetry run python lesson_01_basic_azure_openai.py
# ReAct pattern
poetry run python lesson_02_react_pattern.py
# LangChain basics
poetry run python lesson_03_langchain_basics.py
# Tool calling with MCP
poetry run python lesson_04_tool_calling_mcp.py
# Advanced LangGraph workflows
poetry run python lesson_05_langgraph_advanced.py
# LangChain agent with custom tools and web search
poetry run python ai_agent_experiments/lesson_07_langchain_agent.py
# Interactive chat with tool calling
poetry run python main.pyRun the LangChain agent with custom tools and web search:
poetry run python ai_agent_experiments/lesson_07_langchain_agent.pyThis will demonstrate:
- Calculating interest using a custom tool
- Performing a web search for recent job postings using TavilySearch
Pro Tip: Open each .py file in your editor and read through the code. The comments and structure are designed to teach you how AI agents work!
The project uses a simple configuration system:
- Environment Variables: Set in
.envfile (see.env.template) - MCP Servers: Configured in
config.json - Azure OpenAI: All settings via environment variables
-
"Module not found" errors: Make sure you're running from the project root and have installed dependencies with
poetry install -
Azure OpenAI connection issues: Verify your
.envfile has the correct Azure OpenAI credentials -
MCP connection errors: Ensure the research server is properly configured in
config.json -
Import errors: Make sure you're using Python 3.12+ and have activated the Poetry environment
- Check the Issues page
- Review the Azure OpenAI documentation
- Explore the LangChain documentation
- Deep Learning Course on MCP
- AI Agents with MCP
- RAG Tutorial
- OpenAI Embeddings Guide
- LangGraph Documentation
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Azure OpenAI team for the excellent API
- LangChain team for the amazing framework
- Anthropic for MCP protocol
- All the open-source contributors who made this possible