Performance: Source citation in RAG responses
MEDIUM IMPACT
This concept affects the response generation speed and user experience by adding source references in retrieval-augmented generation (RAG) outputs.
const { answer, sources } = await ragModel.generateAnswerWithSources(query); // includes source citationsconst response = await ragModel.generateAnswer(query); // no source citation included| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No source citation | Minimal DOM nodes | 0 reflows | Low paint cost | [OK] Good |
| With source citation | More DOM nodes for citations | 1-2 reflows | Moderate paint cost | [!] OK |