AI integration
Language models as drafting tools, with a teacher in the loop.
AI supports case creation and feedback. It does not diagnose, and its evaluations and image analyses become visible to students only after teacher approval.
Where AI is used
- Synthetic case generation
- Claude
- Answer evaluation with rubric
- Claude, plus retrieved context
- PDF case detection and extraction
- Claude, after PDFBox text extraction
- Practice questions and evaluation
- Claude
- Image analysis and curation
- Claude with image input
- TR / EN translation
- Claude
- Gleason pattern suggestions
- Claude (the grade is computed deterministically)
- Embeddings
- Ollama, nomic-embed-text
The Claude model is a configuration value. All calls are synchronous; there is no streaming.
One gateway
Every Claude call passes through one client. It marks the system prompt for prompt caching, places image blocks before text in vision calls, logs input, output, cache-creation and cache-read tokens for each call, retries with exponential backoff where requested, and wraps all failures in one exception that the API returns as 502.
The evaluation prompt was restructured so the rubric and format rules form a static system prompt and only the case and answers vary. That ordering is what makes caching effective. No cost or latency numbers are claimed.
Retrieval for evaluation
- 01
Chunk
Case text is split into 500-character chunks with 100 characters of overlap.
- 02
Embed
Each chunk is embedded by a local Ollama model and stored in MongoDB.
- 03
Rank
The question title is embedded; cosine similarity is computed in memory over that case's chunks.
- 04
Prompt
The top three chunks are added to the evaluation prompt. No chunks, no context.
Ranking in memory avoids running a vector database and is adequate for the few chunks a single case produces. It is not meant for corpus-wide search, and it was not benchmarked against alternatives.
Two-stage PDF import
- 01
Extract text
PDFBox reads the PDF. Non-admin teachers are limited to 15,000 characters.
- 02
Detect cases
A first Claude call returns how many cases there are and their character ranges.
- 03
Extract fields
Each range gets its own call that returns structured case fields.
- 04
Store and index
Cases are saved, images go to GridFS, and text is chunked and embedded.
Vision and grading
Image analysis produces an educational description of a case image and is stored as pending until a teacher approves it. Images are downscaled, and can be cropped, before being sent. Tumor grades are computed by pure, unit-tested calculators; the model may only suggest patterns, and each grading records whether it was manual or AI-suggested.
Not implemented
Streaming responses, per-user rate limits on AI endpoints, schema validation beyond JSON parsing, and a measured cost or latency baseline. An evaluation harness skeleton with synthetic cases exists; no benchmark results are claimed.