Performance: Why conversation history improves RAG
MEDIUM IMPACT
This concept affects the responsiveness and relevance of retrieval-augmented generation by managing how much data is processed and rendered during interactions.
const recentHistory = chatLog.slice(-5).join(' '); const response = await ragModel.generate({ query: userInput, context: recentHistory });
const conversationHistory = fullChatLog.join(' '); const response = await ragModel.generate({ query: userInput, context: conversationHistory });
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full conversation history as context | Minimal DOM changes | 0 | Low paint cost | [X] Bad due to slow input processing |
| Limited recent history as context | Minimal DOM changes | 0 | Low paint cost | [OK] Good balance of relevance and speed |