RAG
Every agent response in Rosetta is backed by retrieved sources: your uploads, your account library, and public medical databases. Agents don’t answer from memory alone.
Architecture
Source documents are split into passages, and each passage is converted into a vector that represents its meaning, not the exact words. 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). That’s why a search for “heart failure treatment” can match a passage that says “HFrEF management”: the two mean roughly the same thing, so their vectors sit near each other.
Semantic vs Keyword
Keyword Search (Traditional):
Query: "heart failure treatment"
Matches: Exact text "heart failure" AND "treatment"
Misses: "HFrEF management", "cardiac dysfunction therapy"Semantic Search (Rosetta):
Query: "heart failure treatment"
Matches: Any semantically similar concepts
- "HFrEF management"
- "cardiac dysfunction therapy"
- "GDMT for reduced EF"Source Types
- Local: sources attached to the current note. Good for one-off uploads tied to a specific patient.
- Account: guidelines, protocols, and papers in your persistent library. Indexed once and available to every note on your account.
PubMed Integration
PubMed is a third source type. Unlike local and account sources, it’s queried live:
- The agent rewrites your request into a PubMed search string.
- Top results come back with their abstracts and metadata.
- Those abstracts are embedded and mixed into the same retrieval pool as your local and account sources. Citations can come from any of the three.
Usage Examples
Evidence-Based Treatment
Add a guideline PDF to your Account library. Ask “heart failure reduced ejection fraction treatment” in a note. The agent retrieves guidance and generates a plan with citations from the uploaded PDF.
Literature Review
The agent searches PubMed for recent abstracts on a topic and generates a summary with current scoring criteria.
Institutional Protocols
Upload a hospital protocol to the Account library. Query it by name (e.g., “UCSF sepsis bundle timing”) and the agent returns the relevant details.