An AI-assisted teaching app based on mdbook.
- Supports book creation, deletion, reading, searching, and other functions.
- Supports AI-assisted teaching to help students better understand book content.
touch .env
# sqlite database file path, only need in compile time
echo "DATABASE_URL=sqlite:./database/book.db" >> .env
# need in runtime
echo "OPENAI_API_KEY=your_openai_api_key" >> .env
echo "OPENAI_BASE_URL=your_openai_base_url" >> .env
echo "AI_MODEL=model_name" >> .env
- Backend: Rust (axum, sqlx)
- Frontend: Svelte
- Database: SQLite
- Artificial Intelligence: OpenAI API
Import books (epub, mdbook.zip), generate book summaries and chapter summaries, and import them into the database.
Users open a book, an initial teaching plan is generated and saved to the database, a teacher AI agent is created, and users can learn through dialogue.
The teacher agent can use function calling to:
- Retrieve book content (including table of contents, summaries, specific chapter content)
- Get information about the student's learning status (including overall learning plan, overall learning progress, chapter-by-chapter learning progress) The teacher agent's conversation history is saved to the database in real-time, with context length calculated in real-time. If the limit is exceeded, the earliest conversations and corresponding database entries are deleted.
Every 10 minutes/upon exit/when actively clicking save, a separate AI summarizes the conversation content and uses function calling to:
- Update chapter learning progress
- Update overall learning progress
- Update the learning plan