Skip to content

Senku is an offline-first AI teacher that turns any textbook PDF into a guided classroom experience, autonomously extracting the curriculum and teaching each topic step by step like a real teacher

Notifications You must be signed in to change notification settings

aswinms926/Tutor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Senku - Autonomous AI Teacher

Transform textbooks into engaging, autonomous classroom experiences

Senku is an AI-powered autonomous teaching system that brings the best of classroom teaching to digital learning. Unlike traditional chatbots or Q&A systems, Senku actively teaches entire textbooks with natural speech, structured curriculum, and intelligent pacingβ€”just like a real teacher.


🎯 Why Classroom Teaching?

The Problem with Current AI Learning Tools

Most AI learning tools (ChatGPT, Grok, etc.) are reactiveβ€”they wait for you to ask questions. This approach has fundamental limitations:

  • ❌ No structured learning path - Students don't know what they don't know
  • ❌ Passive engagement - Requires constant user input and motivation
  • ❌ Fragmented knowledge - Learning happens in disconnected chunks
  • ❌ No curriculum planning - Missing the big picture and learning progression

Why Senku's Classroom Approach is Superior

βœ… Autonomous Teaching - Senku actively teaches you, not the other way around
βœ… Structured Curriculum - Automatically extracts and follows a logical learning path
βœ… Natural Classroom Experience - Engaging voice, pacing, and delivery like a real teacher
βœ… Complete Coverage - Teaches entire textbooks systematically, nothing gets missed
βœ… Intelligent Pacing - Pauses, emphasis, and rhythm designed for comprehension
βœ… Offline-First - Works completely offline with local AI models and TTS

Think of it this way: Would you rather ask a book questions, or have an expert teacher guide you through it? Senku is the latter.


πŸš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • Git
  • 4GB+ RAM recommended

Installation

  1. Clone the repository

    git clone https://github.com/aswinms926/Tutor.git
    cd Tutor/senku
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up environment variables

    Create a .env file in the senku folder:

    # Required: Gemini API for curriculum extraction and lecture generation
    GEMINI_API_KEY=your_gemini_api_key_here
    
    # Optional: Inworld AI for premium TTS
    # If not provided or if API fails, system automatically uses offline Piper TTS
    INWORLD_API_KEY=your_inworld_api_key_here
    INWORLD_API_SECRET=your_inworld_api_secret_here

    Get your API keys:

    Note: Senku works completely offline for TTS! If Inworld API is unavailable or fails, the system automatically falls back to offline Piper TTS. Your teaching sessions will continue uninterrupted.

  4. Run the application

    python api_server.py
  5. Open your browser

    Navigate to: http://localhost:5000


πŸ“– How to Use

Step 1: Upload a Textbook

  • Drag and drop any PDF textbook into the upload zone
  • Senku will process it and extract the curriculum automatically
  • Supports textbooks of any size (tested with 500-700 page books)

Step 2: Review Curriculum

  • View the automatically extracted chapters and topics
  • See the structured learning path Senku will follow

Step 3: Start Autonomous Teaching

  • Click "Start Autonomous Teaching"
  • Sit back and learn as Senku teaches the entire curriculum
  • Natural voice with intelligent pacing and emphasis
  • Follow along with synchronized text highlighting

Controls

  • Pause/Resume - Take breaks when needed
  • Stop - End the session and upload a new textbook

πŸ—οΈ Architecture

senku/
β”œβ”€β”€ api_server.py          # Flask API server
β”œβ”€β”€ senku.py              # Main entry point
β”œβ”€β”€ config.py             # Configuration management
β”œβ”€β”€ requirements.txt      # Python dependencies
β”‚
β”œβ”€β”€ ingestion/            # PDF processing & curriculum extraction
β”‚   β”œβ”€β”€ pdf_processor.py
β”‚   └── curriculum_extractor.py
β”‚
β”œβ”€β”€ teaching/             # Autonomous teaching engine
β”‚   β”œβ”€β”€ autonomous_teacher.py
β”‚   β”œβ”€β”€ lecture_generator.py
β”‚   └── tts_engine.py
β”‚
β”œβ”€β”€ vector_store/         # RAG system for context-aware teaching
β”‚   └── chroma_store.py
β”‚
β”œβ”€β”€ web/                  # Modern web interface
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ app.js
β”‚   └── styles.css
β”‚
└── data/                 # Storage
    β”œβ”€β”€ audio_cache/      # Cached TTS audio
    └── chroma_db/        # Vector database

πŸ”Œ Dashboard Integration

Want to integrate Senku into your existing classroom dashboard or LMS?

See INTEGRATION.md for complete integration documentation, including:

  • βœ… REST API reference
  • βœ… React/JavaScript examples
  • βœ… Python/Flask backend integration
  • βœ… Complete working examples
  • βœ… Security best practices
  • βœ… Attendance tracking integration

Quick Start:

// Start teaching session from your dashboard
const response = await fetch('http://localhost:5000/api/teach', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ pdf_hash: 'your_pdf_hash', voice_enabled: true })
});

🎨 Features

πŸ€– Autonomous Teaching

  • Teaches entire textbooks without user intervention
  • Follows extracted curriculum systematically
  • Natural classroom-like delivery

🎯 Smart Curriculum Extraction

  • Automatically identifies chapters, sections, and topics
  • Creates a structured learning path
  • Adapts to different textbook formats

πŸ”Š Expressive Voice

  • Natural speech with pauses and emphasis
  • Offline TTS fallback for privacy
  • Audio caching for instant replay

πŸ’Ύ Intelligent Caching

  • Lectures cached for instant access
  • Audio cached to save processing time
  • Resume teaching from where you left off

🌐 Modern Web Interface

  • Clean, intuitive design
  • Real-time progress tracking
  • Responsive on all devices

πŸ› οΈ Technology Stack

  • Backend: Python, Flask
  • AI/ML: Google Gemini, ChromaDB, Sentence Transformers
  • TTS: Inworld AI (with offline fallback)
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • Storage: Local file system, SQLite

πŸ“ Configuration

Edit config.py to customize:

  • API endpoints and ports
  • Model selection (Gemini, OpenAI, etc.)
  • TTS settings
  • Cache behavior
  • Teaching parameters

🀝 Contributing

This is a team project. To contribute:

  1. Create a feature branch

    git checkout -b feature/your-feature-name
  2. Make your changes and commit

    git add .
    git commit -m "Description of changes"
  3. Push to the repository

    git push origin feature/your-feature-name
  4. Create a pull request for review


πŸ› Troubleshooting

API Server won't start

  • Check if port 5000 is already in use
  • Verify all dependencies are installed: pip install -r requirements.txt

No audio playback

  • Ensure pygame is installed
  • Check system audio settings
  • Verify TTS API keys in .env file

PDF processing fails

  • Ensure the PDF is not password-protected
  • Check available disk space for vector database
  • Try with a smaller PDF first

Curriculum extraction issues

  • Verify Gemini API key is valid
  • Check internet connection
  • Ensure the PDF has clear chapter/section structure

πŸ“„ License

[Add your license here]


πŸ‘₯ Team

[Add team member names and roles]


πŸ™ Acknowledgments

Built with passion for transforming education through AI.

Remember: Senku doesn't just answer questionsβ€”it teaches. That's the difference between a tool and a teacher.

About

Senku is an offline-first AI teacher that turns any textbook PDF into a guided classroom experience, autonomously extracting the curriculum and teaching each topic step by step like a real teacher

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published