📋 Project Overview & Problem Statement
Challenge: Teachers spend countless hours creating age-appropriate science lessons, researching educational content, designing visuals, writing quizzes, and ensuring curriculum alignment. This process is time-consuming, requires expertise across multiple domains, and often lacks consistency in quality and reading level.
Solution: Science Learning Materials Builder is a 4-agent AI system that automates the entire lesson creation workflow for Grade 4 science (ages 9-10). It researches topics via web search, validates curriculum alignment (NGSS standards), generates kid-friendly explanations at 3rd-grade reading level, creates educational illustration prompts, designs quizzes, and exports complete lesson plans in markdown and PDF formats.
Key Benefits
- Time Savings: Reduce lesson planning from hours to 2-3 minutes
- Curriculum Alignment: Based on Next Generation Science Standards (NGSS) for Grade 4
- Age-Appropriate Content: 3rd-grade reading level with simple vocabulary and clear explanations
- Complete Lessons: Teacher guides, student worksheets, quizzes, answer keys, and activities
- Ready to Use: Export to PDF for immediate classroom distribution
🛠️ Technical Architecture & AI Processing
AI & Content Generation
Google Gemini 2.0 Flash
Tavily Web Search
Python 3.8+
Google Colab
NGSS Standards
Document Processing
Markdown Formatting
WeasyPrint (PDF)
markdown-it-py
JSON Processing
Image Prompt Generation
Content Generation Workflow
Sequential Agent Execution:
- Stage 1: Research Agent searches web and validates curriculum standards
- Stage 2: Illustrator Agent creates prompts for 3 educational visuals
- Stage 3: Writer Agent generates kid-friendly content and assessments
- Stage 4: Packaging Agent compiles everything and exports to PDF
Reading Level & Age-Appropriateness
- Target Audience: 9-10 year olds (Grade 4)
- Reading Level: 3rd Grade (Flesch-Kincaid verified)
- Sentence Length: Maximum 15 words per sentence
- Vocabulary: Simple words with clear definitions
- Examples: Concrete, real-world scenarios kids understand
📖 Usage Guide & Examples
Generate a Complete Lesson
# Generate lesson on Photosynthesis
result = run_science_lesson_pipeline("Photosynthesis")
# View the generated lesson
with open(result["lesson_path"], "r", encoding="utf-8") as f:
lesson_content = f.read()
# Display in notebook
display(Markdown(lesson_content))
# Export to PDF
pdf_filename = result["lesson_path"].replace(".md", ".pdf")
markdown_to_pdf(lesson_content, pdf_filename)
Custom Topic Example
# Generate lesson on any science topic
result = run_science_lesson_pipeline(
"How does a cactus survive in the desert?"
)
# Outputs:
# - science_lesson_cactus_grade4_20250124.md
# - science_lesson_cactus_grade4_20250124.pdf
# - diagram_cactus.txt (image prompt)
# - fun_illustration_cactus.txt
# - process_cactus.txt
Example Output: "How does a cactus survive in the desert?"
Learning Objectives:
- Understand cactus adaptations for water conservation
- Identify how cacti survive extreme heat
- Explain the role of spines in protection and water retention
Sample Fun Facts:
- Some cacti can live for over 200 years!
- Cacti store water in their thick stems like giant water bottles
- Cactus spines are actually modified leaves
- The largest cactus can grow taller than a 5-story building
Quiz Sample:
"Why do cacti have spines instead of leaves?"
- A. To look pretty
- B. To reduce water loss ✓
- C. To attract animals
- D. To help them grow faster
🚀 Getting Started with Google Colab
Quick Start (3 Steps)
- Step 1: Open Google Colab Notebook
- Step 2: Add API keys to Colab Secrets (🔑 icon in sidebar):
- Step 3: Run all cells and generate your first lesson!
Lesson Plan Contents
Each generated lesson includes:
- Teacher Guide: Learning objectives, key concepts, teaching tips, materials needed
- Student Worksheet: Explanation, visuals, vocabulary, quiz, fun challenge
- Answer Key: Complete solutions for all assessment questions
- Markdown File: Editable source for customization
- PDF Export: Ready for printing and classroom distribution