Graph RAG with Kuzu #5346
-
|
Hello, I am building a Graph RAG (for hybrid search) with Kuzu. Currently, I see two options for implementation:
The second option seems simpler, in my opinion, and has also yielded better results in the first couple of tests compared to LlamaIndex. This has made me wonder: what are the benefits of using LlamaIndex, as it appears to be the more popular approach? What is your opinion on this? Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Hi @sajozsattila, there is a third option, which imo is the best one: It's based on BAML. It's an improvement on the second option (that used ell), and the reason I think it's better is that you have much more fine-grained control over the prompting layer using BAML. You also have the ability to write tests and do a lot more rigorous prompt engineering than the earlier two approaches. LlamaIndex is the most rigid and inflexible of these approaches, as the prompt logic is lost in 5 layers of abstraction and you have to conform to their abstraction philosophy to use it. BAML is low level, and very, very powerful in this regard, and offers full transparency and flexibility to the developer. Highly recommend it. I plan on adding vector search + graph traversal examples in due course, but if you look at our latest release of Kuzu (0.9.0), you have a vector index natively in Kuzu, which should allow you to add embeddings as properties on the nodes and use the results from the vector search for downstream graph traversal too. Will post more examples on this soon, but of you get stuck, please join us on Discord and ask us your questions there. Cheers! |
Beta Was this translation helpful? Give feedback.
-
|
One thing regarding this: schema discovery is very important, and I think that for the best RAG solution, in an ideal case, we can add some descriptions to the objects and properties. This way, the schema will be more understandable by the LLM. For example I would like to format the prompt something like this: For this, I need to record these descriptions somewhere. Do you have any ideas on how to do this within Kuzu? |
Beta Was this translation helpful? Give feedback.
Hi @sajozsattila, there is a third option, which imo is the best one:
https://github.com/Connected-Data/cdkg-challenge/tree/main/src/kuzu
It's based on BAML. It's an improvement on the second option (that used ell), and the reason I think it's better is that you have much more fine-grained control over the prompting layer using BAML. You also have the ability to write tests and do a lot more rigorous prompt engineering than the earlier two approaches. LlamaIndex is the most rigid and inflexible of these approaches, as the prompt logic is lost in 5 layers of abstraction and you have to conform to their abstraction philosophy to use it. BAML is low level, and very, very powerful in this reg…