3 ms·
There is no one size fits all formula. For simple RAG, a search query (vector, keyword, SQL, etc) works to build a context. For more complex questions or resea
by dmezzetti 2y ago
There is no one size fits all formula. For simple RAG, a search query (vector, keyword, SQL, etc) works to build a context.
For more complex questions or research, a knowledge graph can be beneficial. I wrote an article[1] earlier this year that used graph path traversal to build a context.
The goal was to build a short narrative about English history from 500 - 1000 using Wikipedia articles. Vector similarity alone won't bring back good results. This article used a cypher graph path query that jumped multiple hops through concepts of interest. Those articles on that path were then brought in as the context.
[1] https://neuml.hashnode.dev/advanced-rag-with-graph-path-traversal https://neuml.hashnode.dev/advanced-rag-with-graph-path-trav...