Description
Fahem AI: Localized Curriculum Multi-Agent AI Tutor An intelligent, multi-agent AI tutor tailored strictly to local school curricula with enterprise-grade pedagogical safety guardrails, specialized cognitive management, and a compliance-first architectural framework.
Inspiration
Traditional AI applications often fail students because they lack structured, verified knowledge of localized school curricula. When students interact with generalized large language models, the AI is prone to hallucinating facts, referencing foreign study programs, or drifting into topics completely unrelated to the student's specific grade level and academic standards. In high-stakes educational frameworks, generic AI outputs are not just unhelpful—they can actively introduce distraction and academic drift.
Fahem was built to bridge this critical gap. The goal was to create an intelligent learning companion and interactive digital curriculum library that knows a student’s exact official school textbooks inside and out, provides verified answers mapped precisely to textbook pages, delivers smart continuous testing, and maintains a strictly safe, distraction-free educational environment suited for students and younger demographics.
Research Foundations & Learning Pedagogy
The architectural design of Fahem is grounded in deep research into educational psychology and adaptive systems. Our research phase heavily utilized Google NotebookLM to cross-examine and synthesize pedagogical frameworks, transforming unstructured educational theories into computational multi-agent protocols.
Autodidactive Heutagogy: Fahem is engineered around self-determined learning. Instead of passively feeding answers, the system acts as a guide, prompting students to manage their own learning paths and cultivate critical problem-solving skills.
The CCIRI Learning Framework: We implemented a multifaceted cognitive approach abbreviated as CCIRI:
- Collaborative: The agent pairs with the student to co-create solutions.
- Constructive: The system builds on the user's current knowledge base rather than replacing it.
- Integrative: Connecting cross-chapter concepts to provide a holistic view of the curriculum.
- Reflective: Forcing metacognitive checkpoints where students summarize what they have learned.
- Input-Based: Dynamically tailoring system responses based on highly granular feedback loops from user interactions.
The OEPA Onboarding Methodology: The student lifecycle progresses through an engineered onboarding and navigational system:
- Onboarding: Initial profile building, evaluating baseline grade competencies, and configuring localized constraints.
- Exploration: Interactive exploration of the textbook database with guided agent prompting.
- Path-Finding: AI-driven gap analysis designed to target specific weaknesses in the student's curriculum understanding.
- Arrival: Achievement of mastery over a specific milestone, validated by the Quiz Agent.
Cognitive Load Theory & Cognitive Management: The system is programmatically managed to prevent cognitive overload. Agents chunk explanations based on age brackets, adapt syntactic complexity dynamically, and use visual/textual isolation mechanics to keep working memory focused exclusively on the problem at hand.
How I Built It
Fahem is engineered and built over the amazing Google ADK 2.0 utilizing multiple GCP Services and integrating through a secured MongoDB MCP layer to MongoDB Atlas database as a scalable, modular microservice architecture partitioned into distinct intelligent layers to ensure clean execution, strict boundary control, and enterprise-grade performance.
The Ingestion Pipeline (ingestion_v2): An automated, asynchronous pipeline dedicated to transforming official textbook PDF structures. The line handles textbook fetching, structural parsing, translating, and vectorizing, converting raw educational prose into a high-performance vector index optimized for Retrieval-Augmented Generation (RAG).
The Agentic Ecosystem: To ensure strict boundaries, we bypassed monolithic prompts in favor of an explicit multi-agent configuration, listing each specialized agent and its structural purpose:
- Orchestrator Agent: The primary system state machine. It evaluates historical memory, computes user intent vectors, and executes programmatic routing across the agent cluster.
- Onboarding Agent: Collects baseline user configurations and initiates the OEPA journey.
- Academic Agent: Houses curriculum context and handles deep textbook querying, generation, and step-by-step pedagogy.
- Quiz Agent: Manages dynamic testing, computes student grade metrics, and dynamically shifts testing strategies based on performance.
- Guardrail Agent: An inline security layer acting as a prompt-and-response firewall to prevent model drift and hallucination.
- Insights & Analytical Agent: An underlying analytical and forecasting layer that evaluates historical student session telemetry to predict learning curves and highlight hidden performance gaps.
Multi-Agent Memory Management: The platform implements a tiered memory matrix. Immediate context is held in short-term agent state buffers, while cross-agent conversation history, quiz performance metrics, and behavioral traces are persisted as structured timelines inside MongoDB. This ensures that the Orchestrator maintains comprehensive contextual continuity as a student pivots across different learning tasks.
Agentic Coding Environment Guards: During the development and execution phases, we implemented strict sandboxed boundaries. Agent execution contexts are isolated to prevent unsafe code execution, prompt injections, or unauthorized database interactions, ensuring absolute integrity of the system state.
Infrastructure & Google Cloud Platform (GCP) Utilization: The entire application is containerized with Docker and deployed on Google Cloud Run for stateless, horizontally auto-scaling serverless computation. The architecture relies on Gemini Enterprise Agent Platform/ADK 2.0 for model development and hosting, Gemini Models for state-of-the-art multimodal reasoning, and the MongoDB MCP (Model Context Protocol) / SDK layer to seamlessly tie internal databases to agent execution loops.
Orchestration & Workflow Topology
The system operates as an event-driven deterministic state machine wrapped around stochastic AI agents. The workflow follows a strict, safe, and logical pathing algorithm: $$ \text{User Input} \longrightarrow \text{Guardrail Screening} \longrightarrow \text{Orchestrator Intent Resolution} \longrightarrow \text{Agent Dispatch} \longrightarrow \text{Memory Synthesis} \longrightarrow \text{Output Guardrail} \longrightarrow \text{User Response} $$ Ingress and Firewalls: User input hits the ingress layer, where it is immediately scrubbed by the input side of the Guardrail Agent. State and Intent Analysis: The Orchestrator queries MongoDB to ingest short-term session memory and long-term OEPA state. It resolves the intent vector against the combined current context. Dynamic Routing: If a student asks a content question, the Orchestrator dispatches to the Academic Agent, injecting the specific textbook vector chunk retrieved from the RAG database. If the student asks to be tested, control shifts smoothly to the Quiz Agent. Safety Convergence: Before any string is returned to the client, the output passes through the final output guardrail to eliminate accidental drift or hallucination.
Compliance, Security, and Enterprise Hardening
Fahem is built from the ground up with a Compliance-First and Security-in-Mind mentality, recognizing that processing student data requires the highest level of network isolation: VPC Tunneling and Database Isolation: The database layer is completely walled off from the open web. Communication between Google Cloud Run microservices and the MongoDB clusters occurs exclusively through secure VPC Tunneling (Virtual Private Cloud), guaranteeing that student profiles, chat logs, and school analytics never traverse public internet routing channels. Google Cloud Armor: Deployed at the HTTP load balancer level to mitigate distributed denial-of-service (DDoS) attacks, filter malicious web traffic, and block automated scrapers. Google Cloud Model Armor: Utilized to provide content filtering at the foundational model layer, blocking prompt injections, jailbreak attempts, and toxic content generation before it can affect backend agent orchestration.
Challenges I Faced
Textbook Structural Complexity: Official curriculum documents are mathematically and visually non-linear. They contain nested multi-column text, callout boxes, formulas, tables, and charts that throw off traditional document parsers. Engineering an ingestion pipeline that cleanly separates these layers while preserving their logical, page-verified context was a major data engineering challenge. Multi-Agent Orchestration & State Bleeding: Managing dynamic state transitions inside an asynchronous execution loop—such as shifting a student instantly from a theoretical explanation into an adaptive quiz session—required building tight state-machine logic within the Orchestrator to prevent latency spikes and contextual cross-contamination between agents. Strict Vector Database Boundary Control: Forcing standard probabilistic LLMs to rely exclusively on the local textbook vector database instead of falling back onto their vast, generalized pre-trained knowledge required constructing layered, highly aggressive verification guardrails that programmatically double-check context extraction.
What I Learned
Building Fahem demonstrated that deploying AI for real-world education requires completely abandoning the single-prompt wrapper design paradigm. True control, predictability, and safety can only be achieved through decoupled, specialized multi-agent systems that programmatically validate and isolate system behaviors. Furthermore, the project deeply accelerated my practical expertise in architecting layout-aware RAG pipelines, managing vector indexing strategies, and deploying stateless microservice webs on Google Cloud Run with hardened enterprise security profiles.
What's Next for Fahem
The immediate engineering milestone is upgrading our data ingestion pipeline to handle multi-modal processing natively. By using multi-modal vision models, the pipeline will be able to parse, chunk, and embed highly complex math equations, geometric charts, and scientific diagrams. Strategically, the ultimate objective is to leverage this secure, multi-agent architecture to secure official integration paths with educational ministries, scaling Fahem into a primary, accessible, and personalized tutor for millions of students worldwide.
Our road ahead focuses on scaling the system architectural reach, deep automation, and platform accessibility: Multi-Modal Ingestion Expansion: Moving our ingestion engine to native multimodal chunking, utilizing vision models to fully incorporate complex mathematical equations, chemical matrices, geometric charts, and scientific diagrams into the vector domain. Advanced MCP and API Ecosystems: Expanding the deployment of Model Context Protocols (MCP) and third-party educational APIs, allowing Fahem agents to cleanly query external calculators, historical archives, and specialized math engines dynamically. Autonomous AI Scheduling & Planning: Integrating scheduling sub-agents that can build personalized study planners for students, tracking their target exam dates and dynamically assigning curriculum goals. Mobile and Local Edge Architecture: Developing high-performance mobile applications paired with a heavily optimized offline processing mode, ensuring that students in regions with low or intermittent connectivity can continue their educational journeys uninterrupted.
Built With
- antigravity-cli
- css
- docker
- firebase
- gemini
- google-adk-2.0
- google-cloud
- google-cloud-agent-platform
- google-cloud-model-armor
- google-cloud-run
- google-cloud-secret-manager
- google-maps-apis
- mongodb
- mongodb-atlas
- mongodb-mcp
- next.js
- node.js
- python
- typescript

Log in or sign up for Devpost to join the conversation.