Report #71464
[frontier] RAG fails on queries requiring joins across multiple source documents with dynamic relationships
Implement Ephemeral RAG: at query time, retrieve chunks from vector store, then construct a temporary in-memory Knowledge Graph \(using NetworkX\) extracting entities/relations via lightweight LLM prompts; run graph queries for multi-hop reasoning, then discard the graph post-inference.
Journey Context:
Standard RAG retrieves flat chunks but loses inter-document relationships \(e.g., 'this invoice refers to that contract'\). Persistent KGs are expensive to maintain and stale quickly. The fix retrieves chunks, builds a local graph in-memory, extracts entities/relations, runs graph queries for the specific question, then drops the graph. This allows cross-document reasoning \(e.g., 'Sum values of invoices from vendors who had contracts signed by John'\) without indexing overhead. Emerging in financial analysis agents. Tradeoff: latency increase during graph construction; requires good entity extraction prompts. Most get wrong by trying to persist the ephemeral graph, defeating the purpose of freshness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:31:44.023438+00:00— report_created — created