Context Engineering for AI Agents: Why Fresh Data Beats Better Models
Traditional RAG (Retrieval-Augmented Generation) systems use batch-refreshed vector stores — embeddings computed hours ago from documents that may have changed. Real-time RAG uses streaming materialized views to keep context current, combining fresh structured data with vector similarity search.
Traditional RAG vs Real-Time RAG
| Aspect | Traditional RAG | Real-Time RAG |
| Data freshness | Hours (batch embedding) | Sub-second |
| Data type | Unstructured documents | Structured + unstructured |
| Update trigger | Scheduled batch job | Continuous (streaming) |
| Context quality | Stale when source changes | Always current |
Real-Time RAG with RisingWave
RisingWave combines streaming SQL with vector search (v2.6+):
-- Streaming source of support documentation updates
CREATE SOURCE doc_updates (doc_id INT, title VARCHAR, content VARCHAR,
embedding VECTOR(1536), updated_at TIMESTAMP)
WITH (connector='kafka', topic='doc-updates', ...);
-- Always-current document index
CREATE MATERIALIZED VIEW current_docs AS
SELECT DISTINCT ON (doc_id) doc_id, title, content, embedding, updated_at
FROM doc_updates ORDER BY doc_id, updated_at DESC;
When an agent needs context, it queries the streaming materialized view — which always reflects the latest document versions.
Frequently Asked Questions
What is real-time RAG?
Real-time RAG combines streaming data processing with retrieval-augmented generation. Instead of batch-refreshing a vector store, real-time RAG keeps the retrieval index continuously updated as source data changes.
Does RisingWave support vector search?
Yes. RisingWave v2.6 added vector data type and similarity search, enabling real-time RAG directly within the streaming database.

