1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →
Design a RAG system over real-time data, e.g. a news or market-intelligence assistant that must reflect events from the last few minutes.
30-second answerSay your answer out loud first, then reveal.

Key design points
- Freshness SLA: e.g. an event becomes searchable within 60 seconds. Monitor lag from publish time to indexed time per source.
- Dedup and story clustering: the same news appears from 50 outlets. Use near-duplicate detection (MinHash, or embedding similarity) and cluster stories so the answer isn't 10 copies of one fact.
- Recency-aware ranking: score = relevance × time decay; parse temporal intent ("latest", "yesterday", "in 2024").
- Hot / cold tiers: a small hot index with real-time inserts (fast HNSW updates) and a large historical index; query both and merge.
- Entity tagging: companies, tickers and people as metadata for precise filtering.
- Generation: include the current date and each source's timestamp in the prompt; distinguish confirmed facts from developing reports; avoid presenting stale information as current.
- Source reliability scores, to limit misinformation amplification.
Trade-offs: embedding cost at high ingest volume (use smaller embedders and batching); index write amplification; consistency between the hot and cold tiers.
Related
Slow is fine. Stopping is the only problem.