A systematic tour of the ideas that make Cortex trustworthy: grounding, pedagogy, a clean course model, a fast player, two coaches, and the platform underneath.
Cortex is an AI curriculum studio: a subject-matter expert turns raw material into a real, playable course. AI does the heavy lifting, but a human is always in the loop — and every AI output is grounded in the expert's own material.
The clearest mental model is two halves on one platform. First, a self-contained course platform — an admin builder and a learner player, with 8 activity types, progress tracking, and JSON import/export. Second, an AI authoring layer on top: knowledge systems, AI Compose, a knowledge map, a grounded text coach, and a realtime voice coach.
The seam between the two halves is deliberately narrow. The AI layer never writes course tables directly. Every AI flow ends by producing a portable cortex-course/1 JSON spec, which is handed to the same importCourse() a human uses. In other words, AI is a content author — not a privileged path — so everything it produces is reviewable and editable exactly like hand-authored content.
app_cortex__* tables, its own routes under /cortex, its own cortex.manage permission, and its own data client @pm/database/cortex — zero shared runtime code. The two apps can evolve independently.The guiding principle is “the simplest robust thing that works.” Relationships between ideas are lightweight — embedding similarity plus optional manual links, not a heavy prerequisite graph. Nano-lessons are the retrieval unit, so there is no separate chunk table. And all text, embeddings, and JSON run on the existing Google Gemini stack.
Knowledge is organized into knowledge systems — buckets like “Leadership & People Management.” They are the trust boundary; distillation is how raw material earns its way across it.
Ingestion runs in three stages, turning a messy document into small, vetted, single-idea units.
unpdf, DOCX with mammoth, and transcripts are cleaned of timestamps — so the model sees clean prose, not layout noise.Every accepted node’s title, summary, and body is embedded with gemini-embedding-001 (768 dimensions, HNSW cosine index). After each write, up to five “similar” edges are recorded above a 0.62 cosine floor — lightweight relationships computed in code, no hand-drawn dependency graph required.

AI Compose is a wizard with a human decision at every gate — grounded in your knowledge, augmented by fact-checked web research when that knowledge is thin, and shaped by pedagogy, not just facts.
The flow moves from a one-line idea to a real draft course, checkpoint by checkpoint.
Brave Search queries, an LLM synthesizes the hits into atomic nano-lessons, and a second LLM pass fact-checks each against its sources — dropping unsupported claims. The vetted results are embedded into a shared Web Research system, becoming first-class, reusable knowledge that grounds the rest of generation. The web only fills gaps; your knowledge is preferred, and the whole path is fail-soft — no key or any error simply means no extra grounding, never a broken course.node_ids it draws from.cortex-course/1 spec, and handed to importCourse(), which creates a real draft.Expansion is engineered to be robust so the course always assembles — bad items simply arrive as drafts to fix, rather than failing the whole run:
A 13-approach pedagogy catalog — Gagné, 5E, Explicit Instruction, Rosenshine, Merrill, Kolb, UbD, PBL, and more — injects a concrete teaching directive into the outline and expansion prompts.
Underneath the AI layer is a plain, well-shaped course platform — the same one a human authors by hand.
The data is a three-level tree: courses → sections → activities, plus enrollments → activity_progress. Activities carry a denormalized course_id so course-wide queries and the progress rollup can skip a join, and each activity’s slug is unique per course (it drives the player URL). New activities start as draft; only published courses and activities reach learners.
activity-types.js + schemas.js) so the same metadata, validation, and quiz grading run in the editor, the save path, and the player.The learner player lives at /cortex/[courseSlug]/[activitySlug], with a persistent sidebar of sections, a progress bar, and completion ticks. It is built to feel instant.
The performance goal is simple to state: the first lesson is interactive immediately, while the rest of the course loads quietly behind the scenes. Four moves make that true.
GET /api/cortex/courses/[id]/content streams every remaining lesson’s body into an in-memory cache.history.pushState — no server round-trip.Progress is just as direct: each completion POSTs to /api/cortex/progress, a database trigger rolls the completed-vs-required count up onto the enrollment, and gated activity types auto-complete on success.
Two coaches share one thesis — answer only from the knowledge — but serve different people in different modes.
/api/cortex/coach/realtime/session, and the coach runs the same retrieval via /api/cortex/coach/realtime/search — grounded in the course plus the whole knowledge base.Cortex doesn't reinvent the plumbing — it rides on the monorepo's shared platform patterns.
AuthModal opens over the intact work and auto-continues — never a redirect to /login.cortex.manage gates the studio; the client-side mirror is UX-only.ok(data) on success, fail(code, message) on error.