Socratic Tutor — Personalized Learning Engine
A fully OpenClaw-native learning tutor that replaces DeepTutor's core capabilities using OpenClaw's own tools and session memory.
What it does: Socratic tutoring, quiz generation, flashcard creation, mastery learning paths, study plans, document-grounded Q&A.
Architecture:
User message → detect intent → route to capability
→ parse documents (optional)
→ generate LLM prompt
→ OpenClaw LLM call
→ format output
→ write to memory
Usage Pattern
Every interaction follows this sequence:
1. Detect intent
python3 ~/.openclaw/workspace/skills/socratic-tutor/scripts/socratic_tutor.py detect "<message>"
Returns: {"capability": "chat|quiz|flashcard|mastery|plan|explain|solve"}
2. Prepare prompt (reads output from step 1)
python3 ~/.openclaw/workspace/skills/socratic-tutor/scripts/socratic_tutor.py <capability> "<message>"
This writes a JSON prompt to a temp file. The skill reads it and sends to LLM.
3. Execute + remember
After LLM response, append key takeaways to today's memory:
python3 ~/.openclaw/workspace/skills/socratic-tutor/scripts/socratic_tutor.py memory-append "<entry>"
Capabilities
🎓 Chat / Tutor
Natural Socratic tutoring with memory of prior context.
python3 .../socratic_tutor.py tutor "我不理解微分和导数的区别"
📝 Quiz Generation
Generate exam-style questions from any topic or document.
python3 .../socratic_tutor.py quiz "链式法则 calculus | count: 5 | type: multiple_choice"
python3 .../socratic_tutor.py quiz "from_pdf /path/to/chapter3.pdf | count: 10"
Types: multiple_choice (default), short_answer, true_false, calculation, proof, fill_blank
🃏 Flashcards
Create spaced-repetition study cards.
python3 .../socratic_tutor.py flashcards "Python data structures | count: 20"
🗺️ Mastery Path
Adaptive learning path using the Attractor → Naming → Decoupling → Refactoring cycle.
python3 .../socratic_tutor.py mastery "machine learning | level: beginner | days: 14"
python3 .../socratic_tutor.py mastery "线性代数 | level: 入门 | days: 21"
📅 Study Plan
Daily structured study schedule.
python3 .../socratic_tutor.py plan "深度学习 7天"
📄 Document Parsing
Extract and summarize content from PDFs, DOCX, PPTX, MD, TXT.
python3 .../socratic_tutor.py parse /path/to/file.pdf
Supported formats detected by extension: .pdf, .docx, .pptx, .md, .txt
💡 Explain
Socratic explanation of any concept with definition, analogy, examples, and self-check.
python3 .../socratic_tutor.py explain "什么是注意力机制"
Memory Integration
The skill integrates with OpenClaw's memory system:
| Memory file | Content |
|---|---|
memory/YYYY-MM-DD.md |
Daily learning log |
MEMORY.md |
Long-term curated knowledge |
Append to today's log:
# 自动记录,不需手动
The skill automatically:
1. Reads yesterday's memory to understand recent context
2. Writes quiz results, mastery paths, study plans to today's memory
3. Updates MEMORY.md with significant learning milestones
Full Session Workflow Example
User: "我最近在学机器学习,这是我的教材PDF,帮我制定学习计划并出一些练习题"
Skill actions:
1. parse /path/to/ml-book.pdf
2. read memory/YYYY-MM-DD.md (check prior progress)
3. generate mastery path prompt → LLM → output plan
4. generate quiz prompt (from PDF content) → LLM → output questions
5. write both to memory
6. present to user in formatted markdown
Capabilities Summary
| Capability | Trigger keywords | Output |
|---|---|---|
tutor |
帮我、教我、讲讲、不懂 | Socratic dialogue |
quiz |
出题、quiz、exam、考题、刷题 | Questions with answers |
flashcard |
闪卡、背单词、flashcard | Card pairs |
mastery |
学习计划、学习路径、learning path | 4-phase learning cycle |
plan |
制定计划、7天学习 | Daily schedule |
explain |
什么是、定义、原理 | Definition + analogy + example |
solve |
解题、solve、证明、推导 | Step-by-step solution |
parse |
PDF/文件解析 | Extracted text |
Dependencies
The skill tries these libraries in order, falling back gracefully:
- PDF: pymupdf → pdftotext CLI
- DOCX: python-docx
- PPTX: python-pptx
- MD/TXT: stdlib
Optional dependencies (install if needed):
pip install pymupdf python-docx python-pptx
If none are available, document parsing returns a helpful error message rather than crashing.