ComputingScribe AI

Inspiration

Exam-setting season for technical subjects often means days lost to drafting contextual scenarios from scratch, wrestling with LaTeX syntax errors at midnight, and manually verifying that synthetic candidate datasets do not introduce accidental demographic bias. As a computing teacher, I did not need a one-shot chatbot to hand off tasks to; I needed an active co-examiner. I wanted a partner that could sit beside me through the entire setting process: asking clarifying pedagogical questions, proposing structural blueprints before writing code, and remembering personal phrasing preferences across sessions.

I also wanted to explore Google Cloud's agentic ecosystem (Gemini, Cloud Run, and Firestore) to see how far an agent could go with genuine persistence and automated tool execution, rather than relying on a stateless prompt-response loop. Setting examination papers proved to be an ideal proving ground: it requires rigorous adherence to syllabus objectives, mark weighting, and typesetting standards, yet demands enough pedagogical nuance that standard chat interfaces routinely fall short.

There was also an institutional motivation. While LaTeX is the gold standard for typesetting technical papers, relying on a single teacher who knows the tool creates an operational bottleneck. When adoption barriers are high, departments inevitably fall back on inconsistent Word documents with broken indentation, mismatched fonts, and copy-paste artefacts. Building a tool that enables any teacher to produce publication-grade, properly typeset papers without touching raw LaTeX turns isolated expertise into a shared departmental asset.

What it does

ComputingScribe AI is a collaborative co-authoring agent tailored for setting Singapore-Cambridge H2 Computing (9569) examination papers. Instead of generating unverified bulk text, it collaborates iteratively with the educator:

  • Flexible Access Model: Meets teachers where they are, with no forced institutional onboarding to try the tool. A Guest Access (BYOK) mode lets any teacher enter their own Gemini API key and start setting papers immediately, with zero account setup. Teachers who authenticate against the department's Google Cloud project instead run on Vertex AI, inheriting institutional IAM permissions, centralized billing, and audit logging — letting individuals experiment freely while giving departments a governed path to shared adoption.
  • Blueprint-First Planning: Proposes a structured blueprint covering specific Learning Outcomes, Assessment Objective (AO) weightings, and mark breakdowns before drafting questions, allowing educators to review and adjust the foundation upfront.
  • Contextual Scenario Generation: Expands single-keyword prompts into authentic, real-world scenarios (such as fare-gate systems, hospital triage queues, or logistics schedulers) decomposed into precise, syllabus-aligned subtasks.
  • Headless LaTeX Compilation and Self-Healing: Generates authentic Cambridge-style LaTeX, compiles it headlessly in a serverless container, and uses an automated reflection loop to diagnose and correct syntax errors before presenting the finished PDF.
  • Demographic Fairness Safeguards: Synthesises balanced companion datasets (CSVs, candidate rosters) with enforced gender parity and multiracial Singaporean naming distributions, complete with an audit view for verification.
  • Persistent Teacher Memory: Extracts natural language feedback (such as "make subtasks more granular" or "omit docstrings in Section B") into structured rules stored in Firestore, ensuring future drafts automatically match the teacher's style.
  • AI-Generated Examination Visuals: Generates contextually relevant diagrams, illustrations, and scenario images using the Nano Banana 2 Lite model, then automatically embeds them into the LaTeX examination paper. This enables questions to incorporate purpose-built visual stimuli, such as system interfaces, physical layouts, network scenarios, or real-world settings, without requiring teachers to manually source and format accompanying graphics.

How I built it

The project began by identifying the exact failure modes of standard LLMs in exam authoring: lack of institutional memory, inability to balance mark schemes mathematically, and recurring syntax failures during LaTeX compilation. The architecture was designed specifically around these constraints:

  • Reasoning and Structured Generation: Powered by Gemini 3.7 Flash via the Google GenAI SDK, handling blueprint drafting, contextual decomposition, LaTeX authoring, error diagnostics, and rule extraction. Outputs are bound to strict Pydantic schemas to ensure deterministic rendering and automated compilation.
  • Dual-Path Authentication: The GenAI SDK client is instantiated behind a thin factory that switches on session state. Unauthenticated sessions route through the standard Gemini Developer API using a user-supplied key held only in memory for that session (never persisted server-side), enabling frictionless Guest Access. Authenticated sessions instead route through Vertex AI, using Application Default Credentials tied to the signed-in Google Cloud identity, so calls run under the institution's own project, quota, and IAM policy.
  • Serverless Execution: Hosted on Google Cloud Run with a custom container holding a lightweight TeXLive distribution, enabling rapid, scale-to-zero headless compilation without server maintenance overhead.
  • Agent Memory: Backed by Google Cloud Firestore, providing a flexible document model to persist teacher preferences, house styles, and historical feedback across sessions without connection pool bottlenecks. Guest sessions persist memory locally to the session only; memory is durably saved to Firestore once a teacher authenticates.
  • CI/CD Pipeline: Configured using Google Cloud Build and Artifact Registry to automatically build, test, and redeploy container images on every push to the repository.
  • Development Workflow: Scaffolding and rapid iteration were accelerated using Google Antigravity to co-design agent logic and infrastructure wiring in parallel.

Challenges I ran into

  • Developing Agent Architecture from First Principles: Transitioning from an educator mindset to building agentic systems required establishing clear mental models for tool-execution loops. The primary hurdle was balancing open-ended model reasoning against strict structural constraints across multi-step pipelines (blueprint -> generation -> self-healing -> memory commit).
  • Cambridge Typesetting Standards: Encoding authentic Cambridge examination styles into reproducible LaTeX templates required significant fine-tuning. Rules included fixed two-digit pseudocode line numbering, non-wrapping trace tables, rigid subtask numbering hierarchies (1.1, 1.2), and right-aligned mark allocations that remain anchored regardless of content length.
  • Translating Unstructured Feedback into Operational Memory: Storing key-value pairs was straightforward, but extracting actionable, generalised rules from casual comments (such as "make the subtasks more granular") without over-fitting or polluting future unrelated prompts required careful prompt orchestration and schema design.
  • Supporting Two Auth Paths Without Fragmenting the Codebase: Keeping Guest (BYOK) and Vertex AI sessions on a single code path — same schemas, same self-healing loop, same memory interface — while swapping only the credential source underneath required isolating all model calls behind one client factory rather than branching logic throughout the app.

Accomplishments that I'm proud of

  • Authentic Co-Authoring Feel: The agent acts as a genuine co-examiner through its checkpointed blueprint workflow and contextual adaptation, rather than behaving like an opaque text generator.
  • Zero-Touch LaTeX Self-Healing: The automated reflection loop catches obscure TeX errors, unescaped characters, and missing packages, self-correcting them in the background to guarantee clean PDF outputs.
  • Integrated Bias Mitigation: Built-in demographic guardrails actively prevent subtle representation imbalances in synthetic candidate data, ensuring fair test scenarios out of the box.
  • Low-Friction, High-Governance Access: A teacher can try the whole workflow in under a minute with just a Gemini API key, while a department can flip the same tool over to Vertex AI for centralized cost control and access management — without maintaining two separate products.

What I learned

The build reinforced that effective agentic behaviour relies more on structured constraints, tooling, and state management than on raw model scale alone. Giving the model a deterministic schema, persistent state in Firestore, and an automated execution loop to recover from its own compiler errors transformed a generic chatbot into a dependable production tool.

Working on a complete end-to-end build rather than guided Google Cloud Skills labs provided deep practical experience in chaining Google Cloud's developer ecosystem (Gemini, Cloud Run, Firestore, and Cloud Build) into a cohesive serverless architecture.

What's next for ComputingScribe AI

The immediate priority is expanding educator adoption and leveraging the structured .tex outputs to build a searchable question repository:

  • Expanding Teacher Adoption: Onboarding more computing educators across Junior Colleges to test diverse setting workflows, gather real-world feedback, and refine how the agent adapts to varying classroom styles — starting from Guest Access and migrating power users to Vertex AI as departments come on board.
  • Historical Paper RAG Integration: Developing a Retrieval-Augmented Generation pipeline to ingest and index past examination papers, ensuring new drafts preserve institutional rigor while avoiding duplicate scenarios.
  • Structured Question Classification: Parsing exported .tex files to extract semantic metadata (such as Assessment Objectives, syllabus sub-strands, difficulty curves, and mark allocations) to automatically index questions into a structured database.
  • Automated Topical Revision Packages: Using the classified .tex question bank to assemble modular, targeted revision worksheets and mark schemes on demand for specific syllabus topics (such as dynamic data structures or network socket programming).
  • AI-Directed Student Practice: Extending the topic-tagged question bank into a student-facing practice tool that suggests relevant past-year exam questions based on individual conceptual weaknesses.

Built With

Share this project:

Updates

Submission history