Skip to Content
RAGRAG Guide

RAG

Answers draw on retrieved sources: your uploads, your account library, public medical databases, and live web search.

Architecture

Source documents are split into passages, and each passage is converted into a vector that represents its meaning. A query is turned into a vector the same way. Retrieval returns the passages whose vectors are closest to the query vector (by cosine similarity), combined with keyword scoring that still rewards exact terms.

Each source has an “included in ingest” toggle. Only included sources are indexed. Excluding a source removes it from retrieval without deleting it.

Semantic vs Keyword

Keyword search looks for the exact words you typed, the way you would search a PDF for a medication name or a phrase from a guideline. It is precise when the source uses the same wording as your query, but it can miss clinically equivalent language.

Keyword search
Query: "heart failure treatment" Matches: Exact text "heart failure" AND "treatment" Misses: "HFrEF management", "cardiac dysfunction therapy"

Semantic search looks for meaning, so it still matches when the note uses one phrase and the guideline uses another.

Semantic search
Query: "heart failure treatment" Matches: Any semantically similar concepts - "HFrEF management" - "cardiac dysfunction therapy" - "GDMT for reduced EF"

Source Types

  1. Local: sources attached to the current note. Good for uploads tied to a specific patient.
  2. Account: guidelines, protocols, and papers in your persistent library. Indexed once and available to every note on your account.
  3. PubMed: queried live rather than indexed ahead of time. The agent rewrites your request into a PubMed search string, and the abstracts that come back are embedded into the same retrieval pool as your local and account sources.

Citations can come from any of the three.

When a question needs current information that is not in your library or PubMed, the assistant can run a live web search through Tavily, which returns compact results with citations built for use by AI agents.

Without a Tavily key the assistant skips web search and falls back to your other sources. As with every other source, results the assistant uses are cited in the response.