A sophisticated educational AI system built with the Model Context Protocol (MCP) and OpenAI's Agent SDK
Guides students through discovery learning using probing questions instead of direct answers.
Creates personalized, week-by-week curricula with:
- Hands-on projects at each milestone
- Industry-relevant resources
- Built-in assessments
- Realistic timeframes
Generates knowledge dependency graphs showing what concepts are needed before others.
Analyzes student explanations to provide:
- Specific gap identification
- Misconception correction
- Personalized remediation strategies
Enterprise-grade analysis covering:
- Bug detection and edge cases
- Style and readability (PEP 8)
- Performance optimizations
- Security vulnerabilities
- Best practices and design patterns
Creates varied problems with:
- Multiple difficulty levels
- Hints and solutions
- Common mistakes to avoid
- Follow-up challenges
Multi-level summaries including:
- ELI5 explanations
- Technical breakdowns
- Critical analysis
- Practical implications
Optimizes learning with:
- Spaced repetition
- Active recall techniques
- Realistic time allocation
- Progress checkpoints
Aggregates and curates recent news with:
- Article summaries
- Trend analysis
- Multiple output styles
- Original source links
ββββββββββββββββ MCP over STDIO βββββββββββββββββ
β ββββββββββββββββββββββββββββββββΊβ β
β agent.py β β mcp_server.py β
β (Client) β Tool Calls & JSON Results β (Server) β
β ββββββββββββββββββββββββββββββββββ€ β
ββββββββββββββββ βββββββββ¬ββββββββ
β
Agent SDK β
- Tool Discovery OpenAI API
- Context Management - GPT-4o-mini
- Timeout Management - Structured Output
- Conversation Flow - JSON Mode
- Python 3.10 or higher
- OpenAI API key
- (Optional) NewsAPI key for newsletter feature
git clone https://github.com/yourusername/advanced-ai-learning-assistant.git
cd advanced-ai-learning-assistant# Windows
python -m venv venv
venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
# Required
OPENAI_API_KEY=sk-your-openai-key-here
# Optional (for news newsletter feature)
NEWSAPI_KEY=your-newsapi-key-hereGet API Keys:
- OpenAI: https://platform.openai.com/api-keys
- NewsAPI: https://newsapi.org/register (free tier: 100 requests/day)
python agent.py1. Create a Learning Path:
π¬ You: Create a 12-week learning path for machine learning
π€ Assistant: [Comprehensive JSON with weekly curriculum, projects, resources]
2. Map Prerequisites:
π¬ You: What prerequisites do I need for understanding transformers?
π€ Assistant: [Dependency graph showing required concepts]
3. Review Code:
π¬ You: Review this Python code:
def fib(n):
if n <= 1: return n
return fib(n-1) + fib(n-2)
π€ Assistant: [Detailed analysis with performance issues, suggestions, examples]
4. Generate Newsletter:
π¬ You: Create a newsletter with top 10 AI news from this week
π€ Assistant: [Curated newsletter with summaries and links]
5. Assess Knowledge:
π¬ You: Assess my understanding of neural networks: [your explanation]
π€ Assistant: [Personalized feedback with gaps and remediation]
help- Show examples and available toolsclear- Reset conversation contextexit/quit/bye- Exit the program
advanced-ai-learning-assistant/
β
βββ agent.py # Main agent client with chat interface
βββ mcp_server.py # MCP server with 9 advanced tools
βββ .env # Environment variables (create this)
βββ .env.example # Template for environment variables
βββ requirements.txt # Python dependencies
βββ README.md # This file
In agent.py:
mcp_server = MCPServerStdio(
name="Advanced AI Tutor",
params={...},
timeout=300, # Server process timeout
client_session_timeout_seconds=300 # Session timeout
)In mcp_server.py:
MODEL_NAME = "gpt-4o" # Best quality
MODEL_NAME = "gpt-4o-mini" # Fast & economical (default)
MODEL_NAME = "gpt-4-turbo" # High qualityEdit functions in mcp_server.py:
- Modify prompts in each
*_fn()function - Adjust parameters (difficulty levels, timeframes, etc.)
- Add new tools following the existing pattern
python test_newsapi.pypython mcp_server.py# Windows
set DEBUG=true
python agent.py
# Mac/Linux
DEBUG=true python agent.py- Vector database integration for RAG
- Multi-agent collaboration
- Web interface (Gradio/Streamlit)
- File upload support (PDFs, code files)
- Conversation history persistence
- Analytics dashboard
- Multi-language support
- LMS platform integration