An AI-powered, interactive learning platform that adapts to your learning style, background, and goals. Built with Streamlit, LangGraph, and OpenAI, this system simulates a personalized tutor that creates tailored lesson plans, assesses your understanding, and dynamically adjusts the curriculum.
- Personalized Curriculum: Generates lessons based on your Learning Style (Active, Reflective, etc.), Background Level, and Interests.
- Dynamic Adaptation: Uses LangGraph to create a stateful learning loop. It assesses your performance after every lesson and decides whether to:
- Reinforce: Provide more examples.
- Reteach: Explain concepts from first principles if you're stuck.
- Advance: Move to the next topic with a "Graduation Report".
- Multi-Source Citations: Automatically aggregates and cites resources from:
- Arxiv (Direct API integration for research papers)
- Google Scholar (Academic Articles)
- YouTube (Video Tutorials)
- Web Search (Tavily)
- Interactive Exercises: Generates coding exercises (e.g., PyTorch/TensorFlow) relevant to the topic.
- Persistent Memory: Remembers your progress, scores, and knowledge gaps across the session.
The system is split into two main components:
-
Frontend (
app.py): A Streamlit dashboard that:- Captures user profile data.
- Renders generated lessons, code snippets, and specific citations.
- Visualizes assessment scores (Confidence, Accuracy).
- Manages session state and user interactions.
-
Backend Logic (
workflow.py): A LangGraph workflow that manages the learning state.- Nodes:
generate_lesson,assess_learning,evaluate_next_step. - Tools: Integrates
TavilySearch,GoogleScholar,YouTubeSearch, andarxivlibrary. - LLM: Uses
gpt-4o-minifor high-quality, pedagogical content generation.
- Nodes:
- Python 3.10+
- OpenAI API Key
- Tavily API Key (for web search)
- SerpAPI Key (for Google Scholar)
-
Clone the repository:
git clone https://github.com/your-repo/topic-learning-agent.git cd topic-learning-agent -
Install dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile or set up.streamlit/secrets.tomlwith the following keys:OPENAI_API_KEY="sk-..." TAVILY_API_KEY="tvly-..." SERP_API_KEY="..."
Run the Streamlit application:
streamlit run app.pyThe app will open in your browser at http://localhost:8501.
- Create Profile: On the sidebar, select your Learning Style, Experience Level, and Goal.
- Choose Topic: Enter a topic you want to master (e.g., "Attention is all you need", "Quantum Computing").
- Start Journey: Click "Generate Teaching Plan".
- Learn & Interact: Read the lesson, review citations, and solve compliance exercises.
- Assess: Click "Assess Understanding" to take a quiz. The AI will grade you and determine your next step.