Video in the works
Scholiphi
Phi, the admin copilot, answering a real school question, then AI checking a handwritten answer sheet. Demo data only.

About the project
Scholiphi is an app that runs a whole school: classes, homework, exams, fees, transport, hostel and parents. I lead its AI side: an assistant that can answer questions and do tasks across the app, and the AI tools teachers use every day, like homework checking and test creation.
Scholiphi is a school operating system: one platform with apps for admins, teachers, students and parents, covering classes, homework, tests, exams, fees, transport, hostel and admissions. Schools use it every day.
I lead its AI side. At the centre is an agent, an AI assistant that can take actions, which can use the whole app through about 190 tools, so a principal can ask Phi a question in plain words and get a real answer from the school's own data, or have it do something after confirming. Around it are the AI features teachers use daily: homework checking, test generation, curriculum building, and copy-check for handwritten exam sheets.
Everything is built to be safe with real school data. Tools are limited by role, anything that changes data asks first, bulk changes need a person's approval, and every AI call is tracked and priced.
How it works
Someone asks
A teacher, parent, student or principal types or speaks a question in their app.
Only the right tools
Out of 191 tools, the backend sends the model only the 10 to 18 that fit the person's role and the message.
The agent works
It calls read tools that use the same services as the app, so answers match what users see on screen. The reply streams back live.
It asks before changing anything
If a tool would change data, the user approves it first: once, always in this chat, or never. Risky actions like bulk messages ask every time.
Every call is counted
Each AI call is logged with its feature, model, tokens and time, and priced in rupees for the cost dashboard.
Under the hood
- AI gateway
- Rate limits, a circuit breaker, request checks and usage monitoring in front of every model call.
- Tool registry
- 191 tools with role limits and permission flags, registered automatically.
- Model layer
- One client for OpenAI, DeepSeek, Gemini and Groq that falls back when a provider is down, plus ElevenLabs and Groq Whisper for voice.
- Syllabus search
- PDFs split and embedded in Postgres with pgvector, answered with streaming search.
- Copy-check
- A quality gate, reading the pages, mapping answers to questions, rubric grading checked by a second model, and marks drawn on the sheet.
- Caches
- Redis for responses, S3 for image transcripts and spoken replies.
What I did
- Built the AI backbone in my first week: a tool registry, an executor, an orchestrator, streaming replies, and an AI gateway with rate limits, a circuit breaker and usage monitoring. It replaced an older, separate AI server
- Wrote 190 of the 191 tools the AI can call, each limited by role (student, teacher, parent, admin, hostel admin): attendance, homework, tests, fees, transport, timetable, hostel, admissions, exams, refunds and more. Read tools call the same services as the app, so chat answers match what users see
- Kept that many tools accurate and cheap: each turn sends only the 10 to 18 tools that fit the user's role and message
- A permission layer: any tool that changes data asks first. Each chat can be set to Ask, Allow or Deny, and risky one-off actions like bulk messages ask every time
- Phi, the copilot for principals: a pane in the admin dashboard that keeps the conversation across pages and shows plain progress lines instead of tool names
- AI onboarding for new schools, and an import assistant for student CSV files. The AI only proposes a fix from 10 allowed operations; a person approves the preview, and plain code does the import with an audit trail
- Rebuilt AI homework checking: photo answers read, marks for each question, grading tuned to the class, and the teacher edits the draft before any student sees it
- AI tests: adaptive chapter tests from each student's weak topics, grading of handwritten answer photos, and every question tagged with one of 5 thinking skills, shown as a radar chart
- A syllabus knowledge base: admins upload PDFs, which are split, embedded in Postgres with pgvector, and answered with streaming search
- AI curriculum generation in four rounds, ending with a builder that makes a chapter from a PDF and a prompt. Plus AI teaching decks where any single slide can be regenerated, with a present mode
- Cost tracking for every AI call: feature, model, tokens and time across 22 features, priced in rupees, with a cost simulator for super admins
- Led an 11-step cost pass: DeepSeek for text, Gemini for images, Groq Whisper for speech with ElevenLabs as fallback, cache-friendly prompts, Redis and S3 caches, and daily limits per role. Every swap can be rolled back with a setting
- Copy-check, from proof of concept to product: AI checking of handwritten exam sheets. A quality gate, reading the pages, a rubric grader checked by a second model from another family, and teacher-style ticks and comments drawn on the sheet
- Activities end to end: quizzes, worksheets, essays, live quizzes and presentations, with 40+ API endpoints, 16 tables and 5 scheduled jobs
- Teaching modes for the student tutor (guided, direct, creative), a YouTube explainer tool, and the Android release pipeline for three apps
What was new
- Moving AI from a side server into the main backend, as an agent with tools and streaming replies. I also added the first vector search in the codebase
- Keeping about 190 tools usable: trim them per role and per message, and write descriptions that tell the model which tool returns names and which returns counts
- Prompts designed for provider caching: a system prompt that never changes, user context in a second message, and tools in a fixed order. Cached tokens are billed at 10% in our dashboard, so it matches the real bill
- One client for four AI providers, with automatic fallback when one is rate limited or down
- "AI proposes, code applies": for bulk changes the AI only drafts a plan from allowed steps, a person approves it, and the import can only run once
Problems I hit, and how I fixed them
Teachers asked "who was absent today" and the AI answered with counts only.
Fix The tool now returns ready-made name lists, and its description tells the model which tool gives names.
The tools knew fewer status values than the database, so escalated complaints, cancelled leaves and submitted tests were invisible to the AI.
Fix Audited every tool against the database and matched them all.
Maths showed as raw LaTeX, and later our own renderer broke formulas while trying to fix them.
Fix One KaTeX renderer in all four apps that only touches text outside the maths, and one shared checker for $ signs.
Per-question homework grading quietly fell back to the old single score and inflated marks, because the questions sat in an HTML field.
Fix An HTML-aware question reader, a total that always equals the sum of the marks, and stricter grading for older classes.
A double click on Approve could import the same CSV twice.
Fix The import claims the job in one atomic database update, so the second click gets a clear error.
A new admin's temporary password could end up in chat history and be sent back to the model.
Fix It moved to a field that is removed before saving or sending anything to the model, and it's generated securely now.
AI cost per student was too high.
Fix The 11-step cost pass. By the plan's own maths, about 5 times cheaper per student.
Timeline
- Feb 2026Joined. AI backbone shipped in the first week.
- Mar 2026Teacher tools with permissions, the syllabus knowledge base, curriculum generation v1.
- Apr 2026Adaptive tests, handwritten answer grading, thinking-skill tags, AI usage dashboard.
- May–Jun 2026Interactive lessons with voice, teacher-reviewed homework AI, maths rendering, curriculum v2.
- Jul 2026Per-question homework grading, AI cost dashboard, Phi for principals, teaching decks.
- Aug 2026Cost pass, chat agent covers the whole app, Phi sidebar, onboarding and CSV import.
- Sep 2026Activities, teaching modes, and copy-check from proof of concept to product.
Screenshots
To be clear
The 5 times lower cost is a projection from our plan, not a measured result. No student data appears on this site: every example uses demo data. New lesson content for Class 6 is still on a branch; it was drafted with Claude and checked by me against the textbook.
