Skip to content

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:

  1. RAG_ENABLED=false or the assistant is disabled.
  2. Empty index — needs seed (scripts/seed_medical_knowledge.py) or admin upload.
  3. Question too broad / in a different language than the KB.
  4. external mode 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

  1. Read the full answer.
  2. Open the 1–2 sources with the highest similarity.
  3. Cross-check key terms and numbers against the fragment.
  4. 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.