Andy Li
All work
Internal tools

UBC Rover

Internal tools I built as a Learning Technology Rover at the UBC Faculty of Pharmaceutical Sciences. The main one is Curriculum Explorer, a curriculum mapping platform on FastAPI, PostgreSQL with pgvector, the OpenAI Python SDK, React and AWS. It is staged, not in production. The Canvas grade importer has a public sample.

Status
Internal tools. Curriculum Explorer is staged, not in production.
Role
Learning Technology Rover (co-op), Sep 2026 to present
Stack
Python 3.12, FastAPI, SQLAlchemy 2, PostgreSQL (pgvector), OpenAI Python SDK, React, Vite, TypeScript, AWS, Chrome Extensions

Curriculum Explorer

Curriculum Explorer tracks where each concept is introduced, reinforced and assessed across a pharmacy programme, something hard to see from raw folders of course files. It reads each course's slides, syllabus, schedule and lecture transcripts once, and records where each drug, disease, topic or national education outcome appears.

Faculty and programme staff use three views. The Brief lists rule-counted findings on gaps, load and coverage. The Journey tracks how concepts progress across lectures. The Atlas maps concepts as nested clouds that can be regrouped by topic, outcome, drug, disease or session.

Nobody edits the map by hand. A reader who disagrees writes a note in plain language, and the system turns it into recorded adjustments that can be undone.

It is the main project of the role and I am its only developer. Version 2 is a rebuild with a FastAPI and PostgreSQL backend, a React app, and a map engine written in plain TypeScript.

What I worked with

Technology, and what I did with it

Python 3.12, FastAPI, SQLAlchemy 2, Pydantic
As the sole developer on Curriculum Explorer, I built a 59-route FastAPI backend with SQLAlchemy 2 and Pydantic over 45 tables. Its ten-step pipeline cuts exact source quotes from the sentence numbers a model returns.
PostgreSQL and pgvector
I designed the 45-table schema for materials, passages, concepts, occurrences, lenses, guidance adjustments and pipeline runs. It stores 1536-dimension embeddings from text-embedding-3-small in pgvector.
OpenAI Python SDK behind one provider interface
Every model call goes through one interface, so moving to another OpenAI-compatible endpoint is a base URL and key change. The pipeline uses Chat Completions with strict JSON schema structured outputs, and embeddings.
Flex tier, prompt caching, parallel calls, cost reservation
Bulk mapping runs use the flex service tier (half price, slower), up to 8 calls in parallel, and a stable prompt prefix so the provider's prompt cache is hit. A dollar budget per run reserves each request's worst-case cost before sending it, so parallel calls cannot overshoot the cap.
React, Vite, TypeScript
I built the web interface in React, Vite and TypeScript: the Brief, Journey and Atlas views, search, and the plain-language guidance notes.
Canvas 2D map engine
The map is a framework-free engine in plain TypeScript on a 2D canvas. It draws nested concept clouds, and React talks to it through a small set of methods and callbacks.
AWS: CloudFormation, CloudFront, API Gateway, Lambda, EC2, S3, Secrets Manager
I defined the deployment in one CloudFormation stack. Requests go through CloudFront, API Gateway and a Lambda proxy to an EC2 server on a private subnet with no public IP address, with encrypted, versioned S3 buckets and Secrets Manager.
Storage-backed model relay
The server has no internet route, so the app writes each model request to storage and polls for the response, while a relay function outside the private network makes the call. That relay is switched off on the staging site.
JavaScript Chrome extensions and the Canvas LMS API
I built the Canvas grade importer, which imports a CSV of grades and feedback and rereads each submission before writing (public sample at github.com/V3sr/canvas-feedback-import). I also built Canvas Page Assistant, which audits editable course pages and previews repairs.

How a course file becomes a map

One file followed from upload to the reader's screen, through the pipeline's steps.

  1. Course filesSlides, syllabus, schedule, lecture transcripts.
  2. PipelinePython. Ten steps under one spending cap.
  3. DatabasePostgreSQL with pgvector. One set of mapping records.
  4. ReaderReact app. A map engine in plain TypeScript.
  1. Each file is stored once, keyed by the SHA-256 of its bytes, so uploading the same file again reuses the stored copy. The lecture number is read from the file name, and a lecture file that cannot be placed is marked unresolved.

    POST /api/collections/{collection_id}/uploads
    POST /api/collections/{collection_id}/materials/from-upload
  2. Extraction keeps each page number, and a transcript keeps its caption times. Every later claim points back to one of these passages.

  3. Before tagging, the model reads each full lecture and names 6 to 15 concepts (1 to 6 words each, scoped like a learning objective or slide title). Names merge across lectures, and existing vocabulary is offered for reuse.

  4. Passages go to the model in windows, with every sentence numbered and the numbered vocabulary in front. The model answers with numbers only: which concept, which passage, which sentence, how many sentences. The code cuts those sentences out as the quote. A pointer to a sentence that does not exist is dropped and counted.

    <p1 page 4>
    [1] This session introduces metformin as a first choice medicine for type 2 diabetes.
    [2] It lowers the amount of glucose the liver releases.
    </p1>
    
    model   { "v": 12, "p": 1, "s": 1, "n": 1, "role": 1, ... }
            v vocabulary number, p passage, s first sentence, n sentence count (1 to 4)
    code    quote = passage.text[a:b]     stored with its character offsets
  5. An exact name or alias joins the existing concept. Names that sit close together are judged as same, alias, type of, part of, related or different. Only same and alias merge, because a subtype is not a synonym.

  6. Later steps mark where each concept is introduced, reinforced, applied or assessed and align concepts to outcome frameworks. Final steps group concepts, place them on the map and attach a confidence score with its basis.

    discover -> enrich -> consolidate -> classify -> stages
             -> alignments -> objectives -> people -> organize -> placement
  7. Each lens (topics, outcomes, drugs, diseases, sessions) is a projection of the same records. Opening a citation fetches the exact slice of source text, or a signed link to the original file.

    GET /api/collections/{collection_id}/lenses/{slug}/map
    GET /api/collections/{collection_id}/materials/{material_id}/text?start=&end=

The passage and the numbers in step 4 were written for this page. They are not course material.

Citing exact source sentences

This is step 4 on its own. The model has returned six pointers for a short passage. The code keeps the ones that point at real sentences, cuts the quote for each, and drops the one that does not.

What the model returned

6 items returned. 5 kept, 1 dropped.

The passage, numbered for the model

[1] This session introduces metformin as a first choice medicine for type 2 diabetes. [2] It lowers the amount of glucose the liver releases. [3] In the lab, students practise explaining to a patient why it is taken with meals. [4] The quiz at the end asks for two common side effects.

Quote cut by the codeThis session introduces metformin as a first choice medicine for type 2 diabetes.Characters 0 to 81 of the passage. Stored with the tag.

The widget applies the rule to one passage written for this page. The real pass reads windows of passages against a course vocabulary and records more about each tag.

API and data

The backend is a Python 3.12 FastAPI app with SQLAlchemy 2 and Pydantic: 59 routes over 45 PostgreSQL tables. Almost every route sits under one collection, so access is checked per collection and per role. Routes are shown here without their shared prefix.

Main routes, under /api/collections/{collection_id}

POST .../uploads, .../materials/from-upload
Add a course file.
POST .../processing/estimate
Plan the cost of a run, step by step, with no model calls.
POST .../processing/run
Start a paid run under a dollar cap. Admins only.
GET .../lenses, .../lenses/{slug}/map
The list of lenses, and the map for one of them.
GET .../search
Search concepts and passages, filtered by course or lecture.
GET .../materials/{id}/text, /file-link
The exact text behind a citation, or a signed link to the original file.
POST .../guidance
Take a plain-language note, apply it, and return the adjustments it made.
POST .../guidance/{note_id}/revert
Undo one note's adjustments.
GET .../checks/next, POST .../checks
The review queue: mark a tag right, wrong or unsure.

Main tables

materials, passages
Each source file once, and the passages cut from it.
concepts
The shared vocabulary: one teachable idea, one identity.
occurrences
The mapping records: concept, passage, exact quote, role, emphasis, confidence.
stages, alignments
Where a concept is introduced, reinforced, applied or assessed, and which outcomes it fits.
lenses
Saved projections, including custom maps built from a question.
guidance_notes, adjustments
Each note, and every change made because of it, with before and after values.
pipeline_runs
Each run with its requests, tokens, cost and status.
memberships
Who can see a collection, as viewer, contributor, curator or admin.

Design decisions

Version 2 has 36 written decision records. These are the ones that shaped it most.

  1. Rebuild version 2 from an empty tree

    Version 1 had grown into two disconnected data paths and three map renderers. Version 2 carries over the product idea, the approved feel of the map and the data, and none of the code. Version 1 stays live for readers until the switch.

    Instead of continuing to patch version 1.

  2. Plain-language notes instead of manual edits

    People tag inconsistently, so the pipeline produces every mapping. Faculty write a note in plain language. An agent turns it into operations such as rename, merge, hide or add a stage. Each one is validated against the database, recorded with before and after values, and can be undone. Notes keep priority when the pipeline runs again.

    Instead of letting people edit tags, groups or positions by hand.

  3. Project all views from one mapping pass

    One pass reads every passage once and stores mapping records with their metadata. The lenses are deterministic projections of those records. A custom map is built by an agent that searches and groups existing concepts, and it never rereads the sources. Projections rebuild in seconds.

    Instead of a separate tagging pass for every view.

  4. Vocabulary first

    In the first full version 2 map, each window named its own concepts, and most names were used only once. Now discovery names a small vocabulary per lecture first, and tagging can only point at it. A new name is allowed for an important idea nothing covers, and the run counts them.

    Instead of free-text names from every window.

  5. Pointers, not quotes

    A tag is only useful if a reader can check it. The model returns sentence numbers and the code cuts the text, so a quote cannot be misquoted. Output is also shorter: numbers in place of names and quoted sentences.

    Instead of asking the model to copy the quote.

  6. "Not established", never "not taught"

    Missing evidence is shown as missing evidence. Assessed needs a cited assessment item, task or rubric, and repetition alone does not count as reinforcement.

  7. Findings are counted, not written

    The Brief's findings on gaps, load and coverage are counted by rules and worded from templates. No model writes them, and each links to the concepts behind it.

    Instead of a model-written summary.

  8. A map engine in plain TypeScript

    The map is nested 3D clouds drawn on a 2D canvas, with children packed as spheres inside their parent. The engine has no framework in it, and React talks to it through a small set of methods and callbacks. Its behaviour was approved once and then locked.

  9. Reserve the cost before each model call

    Each request reserves its worst-case cost against the run cap until the response returns, so parallel calls cannot overshoot the budget together. A dry run estimates expected and worst-case cost with no model calls.

  10. Relay model calls through storage

    The server sits on a private network with no internet route. To call a model, the app writes a request object to storage and polls for the response while an external relay function makes the call. No network change was needed. On the staging site the relay is switched off.

    Instead of opening an outbound route from the private network.

  11. Confidence is a formula, not a probability

    Each mapping gets one score from six weighted signals: the model's own score, source type, the number of independent passages and materials, teaching emphasis and how exactly the term matched. Without an exact quote the score is zero. The decision record states that the weights are an uncalibrated heuristic to test.

Deployment

Version 1 was deployed to a university AWS development account on Sep 25, 2026. Its server has no public IP address. Requests reach it through a sign-in page, CloudFront, API Gateway and a Lambda proxy to an EC2 instance on a private subnet. Secrets Manager holds credentials, and files sit in encrypted, versioned S3 buckets.

Version 2 uses the same shape, defined in one CloudFormation stack. Between Nov 4 and Nov 10, 2026 I published it to a staging site. Each release arrives as a file the server checks for every two minutes. The installer verifies the digest, checks health and rolls back on failure. A backup was taken before each release.

Canvas grade importer

A Chrome extension for instructors. They upload a CSV of grades and written feedback, read a preview and confirm it, and the extension writes the rows into Canvas.

Between the preview and the save, someone else can change the same grade. So after confirmation the importer rereads each submission. If the grade no longer matches the preview, that row is a conflict: the importer reports the value it found and sends no write for that row.

The import

Student A: blank → 8

What goes wrong

A conflict stops the row before any write, so the last three switches only apply once the first is off.

Write requests sent for Student A0Conflict flagged. The importer reports the grade it found and leaves Canvas as it is.
  1. Importerpreview

    Preview proposed grade

    The preview proposes changing blank to 8.

  2. Instructorafter preview

    Instructor changes grade

    An instructor enters 5 in Canvas after the preview was shown.

  3. Importerreread

    Read current Canvas grade

    Canvas currently shows 5.

  4. Importercompare

    Conflict flagged

    The grade changed to 5 after preview, so this row sends no write.

The same reread handles two more cases. A save can succeed while its response is lost, so the importer reads the submission again and reports the save as recovered only when the expected grade is there. Undo restores the earlier grade only if Canvas still holds the imported value.

The simulator follows the same decisions as the public sample's apply code, for one row with a points grade. Every value is synthetic.

Other work from this role

Canvas Page Assistant

Internal tool

A Chrome extension that audits editable course pages, previews repairs that keep the page source intact, rejects stale content and verifies each save.

GENRx

Fix merged

A fix that saves question edits through an existing server endpoint. It was merged. I have not verified its deployment.

Status

Curriculum Explorer version 2 is employer work, and I am its sole developer. It is staged and has not replaced version 1. Faculty have not reviewed the generated tags for accuracy, and the model relay is switched off on the staging site.

The Canvas grade importer has a runnable public sample on GitHub. Canvas Page Assistant is an internal tool. My GENRx fix was merged, and I have not verified its deployment.

Curriculum Explorer, the Page Assistant and GENRx are described from their private repositories and my own work records. Their code is internal to UBC, and this page holds no student or staff data.