RAG sources (for learners)¶
When the AI Tutor answers with knowledge-base grounding, sources (citations) appear under the reply. This page explains what they mean and how language lanes work.
Why sources exist¶
RAG (Retrieval-Augmented Generation) pulls short fragments from the medical knowledge base into the model / heuristics. Sources help you:
- see what the answer is grounded in;
- double-check wording against the source material;
- judge how closely a chunk matches your question.
Not a full document
The UI usually shows a chunk, not the entire article. Ask a knowledge-base admin for full text if you need it.
Source fields¶
| Field | Meaning |
|---|---|
title |
Material title |
text / content |
Retrieved fragment |
category |
Category: guidelines, diseases, medications, admin, etc. |
language |
Language lane: en or ru |
similarity |
Match quality (0–1, higher is better) |
source |
Backend: local, external, or hybrid |
id |
Chunk id in the index |
Language: two lanes¶
The knowledge base does not mix languages in one search:
| Question / UI | Search |
|---|---|
Russian (ru) |
Only materials with language=ru |
English (en) |
Only materials with language=en |
If you ask in Russian but only the English lane is populated, you may get few or no sources — switch question language or ask an admin to ingest content for the needed lane.
Admins add materials separately on the EN and RU tabs (Knowledge base).
When there are no sources¶
Common causes:
RAG_ENABLED=falseor the assistant is disabled.- Empty index — needs seed (
scripts/seed_medical_knowledge.py) or admin upload. - Question too broad / in a different language than the KB.
externalmode without a reachable external API (soft-fallback to local may apply if local is filled).
The tutor may still answer (LLM without RAG or fallback), but without citations.
How to use citations in practice¶
- Read the full answer.
- Open the 1–2 sources with the highest
similarity. - Cross-check key terms and numbers against the fragment.
- If the chunk is off-topic, rephrase the question more precisely.
Strong vs weak queries¶
| Weak | Better |
|---|---|
| “Heart” | “Initial steps for suspected ACS in an adult” |
| “Антибиотик” | «Эмпирическая терапия внебольничной пневмонии у взрослых» |
| Mixed RU+EN in one message | One language per message |
High similarity does not guarantee clinical correctness — always cross-check with your curriculum protocols.