Data Science2025

DoctorPy

Teaching AI assistant PoC that served as the basis for Space Coders Agency. Microservices architecture, smart cache and semantic search.

PythonStreamlitFastAPIRAGMistral AIRedisMicroservicesEdTechNLP

Concept & Origins

DoctorPy is an AI assistant designed to support learning Python in a personalized way. Developed as a Proof of Concept during a workshop with Wild Code School learners and trainers, it served as an experimental basis before the launch of Space Coders Agency. Issues addressed: • Beginners need answers suited to their level • Recurring questions overload trainers • The lack of instant feedback slows progress • Generic resources do not adapt to the learner's context Teaching approach: • Answers adapted to the level (beginner, intermediate, advanced) • Contextualized, commented code examples • Cited sources to go further (official documentation, best practices) • Intuitive interface inspired by modern chatbots This PoC validated the value of educational AI with end users and shaped the architecture of Space Coders Agency.
3
Levels
<1ms
Cache latency
85%+
Confidence
WCS workshop
Context
DoctorPy home page
Dashboard: system status, getting-started guide and sample questions by level

Microservices Architecture

Modern architecture based on independent microservices, each specialized in a specific function. Main services: • RAG service (port 8002) — Core of the system: generation of answers enriched by the knowledge base • Analytics (port 8003) — Tracking of usage and performance metrics • AI Quests (port 8004) — Gamification system for playful learning • Notifications (port 8006) — Personalized reminders and motivation Smart multi-level cache: • L1 (Memory) — Ultra-fast RAM cache (<1ms), 1,000 entries max • L2 (Redis) — Distributed cache for horizontal scalability • L3 (Disk) — Persistent SQLite cache (500MB max) • Adaptive strategies: LRU, LFU, TTL, SMART depending on the data type Semantic search engine: • Intent recognition (8 types: learn, how_to, debug, explain, compare, example, best_practice, general) • Smart autocompletion with relevance scoring • Extraction of Python entities (variables, functions, loops, classes) • Automatic complexity detection
4
Microservices
3
Cache levels
90%+
Hit rate
8 types
Intents
Cache management
1 / 2
Cache dashboard: real-time statistics, hit rate, maintenance actions

Teaching-Oriented Answers

The core of DoctorPy: structured answers adapted to the learner's level. Standardized answer format: • Explicit title of the concept covered • Accessible explanation with analogies (e.g. "a variable is like a labeled box") • Syntax-highlighted code blocks with comments • Important rules and pitfalls to avoid • Progressive practical examples • Sources available to go further Level adaptation: • Beginner — Simple explanations, no jargon, basic examples • Intermediate — Mid-level concepts, a few technical terms • Advanced — Complex concepts, patterns, optimizations Concepts covered: • Variables, data types, operators • Control structures (if, for, while) • Functions and parameters • Lists, dictionaries, tuples • Error handling (try/except) • Object-oriented programming
20+
Concepts
Progressive
Examples
Cited
Sources
Highlighted
Code
Answer on variables
1 / 3
Explanation of variables: definition, syntax, naming rules, examples

Streamlit Interface

Modern user interface built with Streamlit, optimized for the learning experience. Tab navigation: • Home — System status, getting-started guide, sample questions • Ask a question — Chat interface with level configuration • Cache management — Statistics, optimization, maintenance • Search — Exploration of the knowledge base UX features: • Clickable frequently asked questions to get started quickly • Built-in level selector (beginner/intermediate/advanced) • Confidence and source indicators on each answer • Answer metadata (cache hit, processing time) • Professional dark theme Built-in monitoring: • Real-time service status • Cache statistics (hit rate, evictions) • One-click maintenance actions
Streamlit
Framework
4
Tabs
Dark
Theme
Built-in
Monitoring
Question interface
1 / 2
Question form with level selection and frequent suggestions
  _____  _____ _____
 |  __ \|  __ \_   _|
 | |__) | |__) || |
 |  _  /|  ___/ | |
 | | \ \| |    _| |_
 |_|  \_\_|   |_____|

Self-hosted on Raspberry Pi 5

~/links

$ echo "Made with passion"

© 2026 Abdel Touati