The SLO-grounded
AI tutor for FBISE
NISAAB answers only from the Federal Board's own syllabus, names the learning outcome behind every answer, and turns the whole FSc course into practice, papers, marking and a predicted grade — in English, Urdu and Roman Urdu.
What NISAAB is
NISAAB (نصاب, Urdu for syllabus) is a full study, assessment and classroom platform for students of the Federal Board of Intermediate and Secondary Education (FBISE) sitting the HSSC / FSc exams in Grades 11 and 12. The tutor answers only from FBISE's published Assessment Frameworks and names the learning outcome it came from, so a teacher can check every answer against the official document.
Unlike generic AI that pastes a rough syllabus into a prompt, NISAAB stores the official National Curriculum (NCP 2022-23) and Assessment Framework (ISS-2024) in PostgreSQL as structured rows. Every SLO code, cognitive level, domain and teaching-period count is real relational data, and tutoring, quizzes, papers, marking, study plans and mastery all anchor to those rows.
Grounded answers
Retrieval-augmented: the tutor fetches the exact outcome first, then answers inside it and cites the code.
Real board papers
Full FBISE 2026-pattern papers with the 30/50/20 cognitive split and internal choice.
Written marking
Point-by-point rubric marking and an IBCC predicted grade from your own practice.
Trilingual
Explains in English, Urdu or Roman Urdu, while formulas stay in English for the exam.
Who it is for
FSc students in all three groups — Pre-Medical (Physics, Chemistry, Biology), Pre-Engineering (Physics, Chemistry, Mathematics) and ICS (Physics, Mathematics, Computer Science) — plus teachers who review content and administrators who run live classes.
Coverage
| Subject | Domains | Outcomes loaded | Examined |
|---|---|---|---|
| Physics XI | 7 | 193 | 150 |
| Chemistry XI | 7 | 329 | 217 |
| Biology XI | 9 | 246 | 161 |
| Mathematics XI | 3 | 79 | 61 |
| Computer Science XI | 8 | 22 | 22 |
| Class XI total | 34 | 869 | 611 |
| Physics XII | 7 | 151 | — |
| All loaded | 1,020 |
More than 4,000 practice items are pre-generated — for each examined outcome an explanation, five MCQs and one short question — plus a bank of numericals for the 191 calculation outcomes.
Why FBISE students need this
Since NCP 2022-23, FBISE sets papers from Student Learning Outcomes instead of one textbook, and from August 2026 the pattern is 50% MCQ and 50% descriptive. Students have little targeted help, and general AI does not know what the Federal Board examines.
- Out-of-syllabus answers. Generic AI pulls from CBSE/JEE, A-Levels or university material the board never examines.
- Textbooks don't map to SLOs. No tool links each SLO code to explanations, practice and measurable mastery.
- Fake "board papers". Generators ignore FBISE's 30/50/20 cognitive weighting and Section A/B/C structure.
- No written marking or IBCC grading. MCQs alone can't prepare students for the descriptive sections.
- Language barriers. Most platforms handle Urdu and Roman Urdu poorly.
- Costly, scattered tuition. Academies are expensive and progress is spread across WhatsApp, YouTube and guides.
- Unsafe study groups & buggy quizzes. Fake teachers, phishing links, shared phone numbers, and AI keys that contradict their own explanation.
What students get
Syllabus map
The official syllabus by domain, each outcome with its code, level and a mastery colour.
AI tutor
Ask in any of the three languages. It cites the SLO, draws figures, and can check the FBISE website.
Practice cards
Quizzes, flashcards and zoomable mind maps, right inside the chat.
Exam papers
Mini, Standard, Half and Full-Board papers with a timer and auto-submit.
Written marking
Point-by-point against a mark scheme, with a model answer, labelled AI-estimated.
Progress
Mastery by domain, a trend graph and an IBCC predicted grade with a confidence label.
Study plans
Multi-day schedules in Topic mode or Weak mode, with a read → quiz → paper ladder.
Downloads & sharing
Export quizzes, papers, notes and mind maps as PDF/DOCX, or share a read-only link.
Your own notes
Upload PDFs or DOCX; the tutor searches them first and keeps them private to you.
Live sessions
Weekly classes by subject in Pakistan time, with anti-phishing link checks.
Cohort rooms
Moderated group rooms with polls, media and automatic blocking of personal details.
Teacher review
Approved teachers approve or reject bank items; approved ones get a "Teacher-checked" badge.
How the system is built
A monorepo with a Python uv workspace and one TypeScript app, deployed as a web app, an API and a background worker plus scheduled jobs, all on Google Cloud in asia-south1 (Mumbai) for low latency to Pakistan.
Request flow
- The browser sends an HTTPS request with a Firebase ID token; edu-api verifies it against Google's keys.
- edu-api reads/writes PostgreSQL over a private socket.
- A chat message runs the agent, which calls Vertex AI and streams the reply over Server-Sent Events.
- Long work (a board paper, indexing, generation) becomes a row in the
jobstable; the worker claims it and the UI polls until ready.
Grounding, agents and tools
Built on LangChain and LangGraph. Models are reached through Vertex AI's OpenAI-compatible endpoint with an auto-refreshed service-account token. Four model roles are configured separately so a change for one purpose doesn't disturb the others.
| Role | Used for |
|---|---|
| Tutor | The conversational agent |
| Generation | Quizzes, flashcards, notes, mind maps, explainers, stimulus sets |
| Marking | Grading written answers against a mark scheme |
| OCR | Reading text from images and scanned documents |
Two kinds of retrieval
For the syllabus, a small fixed set, NISAAB scores outcomes by term rarity — a distinctive word like "projectile" counts far more than "effect":
# term-rarity scoring over the subject's outcomes
weight(word) = log((N + 1) / (docs_with(word) + 1)) + 1
score(slo) = Σ weight(word) × matches(word, slo)
For a student's uploaded notes, meaning matters more than exact words, so text is embedded as 3072-dimension vectors in pgvector and matched by cosine similarity, scoped to that student's own project.
The agent loop
An agent built with LangGraph loops: it may call several of its 11 tools, in an order it chooses, before answering. Practice tools end the turn directly so the UI shows an interactive card instead of the model re-typing the questions.
Student: "projectile ki range kaise nikalte hain?" → find_syllabus_slos('projectile range') → returns SLO P-11-B-05, Mechanics, level U/A → answers in Roman Urdu, cites 'SLO P-11-B-05' Student: "is par 5 numericals do" → practice_quiz(slo_codes=['P-11-B-05'], count=5) → pulls 5 from the bank (no model call) → quiz card
One PostgreSQL database
Relational data, vectors and the job queue all live in one PostgreSQL + pgvector database, using SQLAlchemy 2.x and 51 Alembic migrations across 36 tables.
| Group | Tables |
|---|---|
| Identity | users, student_profiles, teacher_profiles |
| Workspaces & RAG | projects, documents, document_segments (Vector 3072) |
| Curriculum | subjects, grade_subjects, curriculum_domains, slos |
| Study assets | quizzes, quiz_questions, flashcards, notes, mind_maps, study_plans… |
| Practice & bank | practice_records, srq_questions, srq_attempts, practice_papers, content_items |
| Community | community_posts, polls, reports, class_sessions |
| Operations | shares, jobs, user_usage |
- Dates as state. Bans, teacher approval and archived workspaces use timestamps, not boolean flags, to avoid stale-flag bugs.
- Cascade deletion. Deleting an account removes its documents and segments with it.
- Provenance. Every bank item carries its review status, reviewer and source.
The assessment engine
Board paper blueprint
| Section | Content | Marks |
|---|---|---|
| A | 56 MCQs + 6 stimulus sets of 4 | 40 |
| B | 7 short questions (4 marks), internal choice | 28 |
| C | 2 extended questions (6 marks), internal choice | 12 |
| Total | Mathematics uses its own blueprint, out of 100 | 80 |
The pattern is pure-Python data, so an FBISE change is a data edit, not a rewrite. The engine hits an exact 30% Knowledge / 50% Understanding / 20% Application split with largest-remainder allocation, interleaves levels so a paper doesn't clump recall at the start, and rotates domains without repeating outcomes.
Mastery
Mastery per outcome is an exponentially weighted accuracy, computed by one advance() function used by both the dashboard and the trend graph, so the numbers always agree.
weight = min(1, max(1/attempts, 0.3) × factor)
mastery += weight × (score − mastery)
# factor 1.0 for marked work, 0.5 for self-rated flashcards
IBCC predicted grade
| Band | A++ | A+ | A | B++ | B+ | B | C+ | C | D | U |
|---|---|---|---|---|---|---|---|---|---|---|
| Score | ≥96 | ≥91 | ≥86 | ≥81 | ≥76 | ≥71 | ≥61 | ≥51 | ≥40 | <40 |
From a PDF framework to live data
Seven stages, repeated for every subject.
Stage 3 uses three parsers: rule-based (Physics, Biology, Mathematics), AI-assisted (Chemistry, whose table lists codes before descriptions) and nested-list (Computer Science). The AI-assisted parser must return exactly the codes a regex found, and every returned word is checked against the source, so wording is never invented.
Built for 16–18 year-olds
- Auth on every route. Every endpoint except health and public read-only shares verifies a Firebase ID token and scopes queries to the user.
- Hidden admin. Admin rights come only from an env setting; unauthorised admin calls return 404, not 403.
- Private database. No public address; reached over a private socket. Secrets live in Secret Manager, never the repo.
- Anti-phishing links. Live-session links must be HTTPS on verified hosts; credential-masking URLs are rejected.
- Community guards. Phone numbers and emails are blocked automatically, backed by AI moderation and reports.
- Your data is yours. Uploads never enter the shared bank; deleting your account deletes your documents.
Deployment & cost
One idempotent shell script runs the whole deployment and also works from Windows Git Bash.
deploy/gcp/deploy.sh setup | deploy | web | migrate | seed | content | e2e | script
The worker scales to zero and is woken every minute by Cloud Scheduler to drain the queue; an always-on mode exists for demo days. As of October 2026 the project ran on Google Cloud free-trial credit (ending December 2026), with Cloud SQL about $10/month and the worker about $1.60/day when kept always-on.
Three ways, verified separately
End-to-end checks
Run against the live deployment, Cloud SQL and Vertex AI after every deploy. All 52 pass.
Offline checkers
Domain-rule scripts for mastery, blueprint, grading and more — no database or key needed.
Frontend tests
Vitest suites for maths rendering, DOCX export and route guards.
| Action | Time |
|---|---|
| Numerical quiz from the bank | ~4 s (was 202 s) |
| Tutor reply to a follow-up | ~11 s |
| Written answer marked | 6–8 s |
| Chapter mind map | Instant |
| Half examination paper | ~90 s |
Why not just a general tool?
| Capability | NISAAB | NotebookLM | ChatGPT / Gemini | Past-paper apps |
|---|---|---|---|---|
| Official FBISE SLO database | Yes (1,020) | No | No | Static PDFs |
| 30/50/20 board paper engine | Yes | No | No (drifts) | Old papers only |
| Rubric marking + IBCC | Yes | No | Ad hoc | Answer keys only |
| Per-SLO mastery | Yes | No | No | No |
| English + Urdu + Roman Urdu | Native | Limited | Unconstrained | Mostly English |
| Verified teachers & cohort rooms | Yes | No | No | No |
Where it stands
Live and complete: FSc Part 1 across all five subjects (869 SLOs) and Part 2 Physics (151 SLOs).
| Next step | Why it matters |
|---|---|
| Teacher review of the bank | Turns 611 outcomes of draft material into trusted material. The most valuable next step. |
| Complete Class XII | Chemistry, Biology, Maths and CS XII remain; same method. |
| Calibrated marking | Compare AI marks against real FBISE examiner scripts. |
| Compulsory subjects | English, Urdu, Islamiat, Pakistan Studies. |
| Closed beta | 50–100 students across two or three colleges before a wider launch. |
Team & licence
| Member | Role |
|---|---|
| Muhammad Saad Cheema | Core engineering, cloud architecture, FBISE domain adaptation, deployment |
| Fatin Khan Jadoon | UI/UX design |
| Ayan Sadiq | Documentation, project team and research |
| Ayan Asim | Documentation, project team and research |
Supervisor: Prof. Mr. Tashfeen Qamar · Islamabad Model College for Boys (IMCB) G-10/4, Islamabad · FDE STEM Competition, Group C, 29 October 2026. Built on EduAgent (Student Trainee Center), MIT License.
NISAAB — independent student project, aligned with the FBISE National Curriculum 2022-23. Not an official FBISE product. Written-answer marks are AI-estimated pending examiner calibration.