Kritik · AI support assistant

Ask Kritik

A retrieval-grounded help assistant built into the Kritik learning platform. It answers from a curated knowledge base, cites every source, and tailors what it reveals to who's asking.

Ask Kritik POST /help/ask
How do I create a group set?
Instructor topic

Groups & Group Activities is managed by instructors in Kritik, so it isn't covered in the student help docs.

9
KB chapters
66
indexed chunks
1536-dim
embeddings
0
ungrounded answers

How a question becomes a grounded answer

Pure retrieval-augmented generation over a knowledge base we authored to be chunk-friendly — no full-context stuffing, no guessing.

01

Knowledge base

9 code-grounded chapters in docs/help/, one concept per section.

02

Chunk

Section-level, breadcrumb-prefixed, with a stable anchor and content hash.

03

Embed

text-embedding-3-small into a pgvector store, reconciled in place.

04

Retrieve

Top-k by cosine, a similarity floor, and a role-scoped audience filter.

05

Answer

Claude Sonnet, grounded strictly on the retrieved chunks, citing each.

What makes it more than a chatbot

Four decisions do the heavy lifting — each one visible in the demo above.

Role-aware

Answers that know who's asking

Role comes from the account permission, server-side. Instructors see the whole corpus; a student asking an instructor-only task gets a clear "that's instructor-managed" flag naming the area — never a confusing dead-end.

Fail-closed

Instructor content can't leak

Audience is set per section, not just per chapter. A student's answer is assembled only from student-visible chunks; the gate detects instructor topics from similarity alone, surfacing just the title label.

Grounded

Cites sources, declines gracefully

Every claim carries a [n] citation back to a source chunk. Off-corpus questions get an honest "not in the help docs" — plus PII scrubbing and an uncited-answer guard on the way out.

Self-contained

A module that lifts out

server/rag/ owns its own table, embedder, reconciler, and retriever behind a single ragService seam — ready to become a standalone kritik.io service without touching the rest of the app.

Built in a day, one phase at a time

Each phase ran the same loop — brainstorm → spec → plan → test-driven implementation, reviewed before moving on.

A · B

Knowledge base from the code

Agents proposed a chapter map; nine chapters filled and verified against their source files.

C · D

Format-lint & the RAG module

Chunker, embedder, pgvector repository, and a reconciler that re-embeds only what changed.

E

The ask endpoint

POST /api/v1/help/ask — validate, sanitize, retrieve, short-circuit, answer, cite.

F · G

The chat surface

An ask-first Knowledge Base page, then pared down to a focused chat experience.

H

Role-aware answers

The instructor-topic gate, plus a section-level audience fix that closed a whole class of leaks.