Skip to content

luiscstr/AI-Learning-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Advanced AI Learning Assistant

A sophisticated educational AI system built with the Model Context Protocol (MCP) and OpenAI's Agent SDK

Python 3.10+ OpenAI MCP License: MIT

πŸš€ Key Features

1. 🧠 Socratic Dialogue Engine

Guides students through discovery learning using probing questions instead of direct answers.

2. πŸ—ΊοΈ Intelligent Learning Path Generator

Creates personalized, week-by-week curricula with:

  • Hands-on projects at each milestone
  • Industry-relevant resources
  • Built-in assessments
  • Realistic timeframes

3. πŸ”— Concept Prerequisite Mapper

Generates knowledge dependency graphs showing what concepts are needed before others.

4. πŸ“Š Knowledge Gap Analyzer

Analyzes student explanations to provide:

  • Specific gap identification
  • Misconception correction
  • Personalized remediation strategies

5. πŸ” Professional Code Reviewer

Enterprise-grade analysis covering:

  • Bug detection and edge cases
  • Style and readability (PEP 8)
  • Performance optimizations
  • Security vulnerabilities
  • Best practices and design patterns

6. 🎯 Adaptive Practice Problem Generator

Creates varied problems with:

  • Multiple difficulty levels
  • Hints and solutions
  • Common mistakes to avoid
  • Follow-up challenges

7. πŸ“š Research Paper Analyzer

Multi-level summaries including:

  • ELI5 explanations
  • Technical breakdowns
  • Critical analysis
  • Practical implications

8. πŸ“… Smart Study Scheduler

Optimizes learning with:

  • Spaced repetition
  • Active recall techniques
  • Realistic time allocation
  • Progress checkpoints

9. πŸ“° News Newsletter Generator

Aggregates and curates recent news with:

  • Article summaries
  • Trend analysis
  • Multiple output styles
  • Original source links

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         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

πŸ“‹ Prerequisites

  • Python 3.10 or higher
  • OpenAI API key
  • (Optional) NewsAPI key for newsletter feature

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/yourusername/advanced-ai-learning-assistant.git
cd advanced-ai-learning-assistant

2. Create Virtual Environment

# Windows
python -m venv venv
venv\Scripts\activate

# Mac/Linux
python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create 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-here

Get API Keys:

πŸ’» Usage

Start the Assistant

python agent.py

Example Interactions

1. 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]

Special Commands

  • help - Show examples and available tools
  • clear - Reset conversation context
  • exit / quit / bye - Exit the program

πŸ“ Project Structure

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

πŸ”§ Configuration

Adjust Timeouts

In agent.py:

mcp_server = MCPServerStdio(
    name="Advanced AI Tutor",
    params={...},
    timeout=300,  # Server process timeout
    client_session_timeout_seconds=300  # Session timeout
)

Change Model

In mcp_server.py:

MODEL_NAME = "gpt-4o"        # Best quality
MODEL_NAME = "gpt-4o-mini"   # Fast & economical (default)
MODEL_NAME = "gpt-4-turbo"   # High quality

Customize Tool Behavior

Edit functions in mcp_server.py:

  • Modify prompts in each *_fn() function
  • Adjust parameters (difficulty levels, timeframes, etc.)
  • Add new tools following the existing pattern

πŸ§ͺ Testing

Test NewsAPI Connection

python test_newsapi.py

Test MCP Server Standalone

python mcp_server.py

Run Agent in Debug Mode

# Windows
set DEBUG=true
python agent.py

# Mac/Linux
DEBUG=true python agent.py

🎯 Future Enhancements

  • 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

πŸ“š Resources & References

About

A sophisticated educational AI system built with the Model Context Protocol (MCP) and OpenAI's Agent SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages