7 ms·
> I feel like I should understand the purpose of knowledge graphs, but I just... don't. Like RAG, it decouples KG size from context size, but unlike RAG, a KG
by visarga 1y ago
> I feel like I should understand the purpose of knowledge graphs, but I just... don't.
Like RAG, it decouples KG size from context size, but unlike RAG, a KG offers deduplication and relational traversal. Some searches based on just similarity or keywords fail when the relation is functional. Both KG and RAG work better when the LLM is planning the search process, doing multiple searches, basing each one off the previous one. In the last few months LLMs have gotten great at exploration with search tools.
I implemented my own KG recently and I put both search and node generation in the hands of the LLM, as MCP tools. The cool trick is that when I instruct the LLM to generate a node it links to previous nodes using inline references (like @45). So I get the graph structure for free. I think coupling RAG with a KG allows for both breadth and precise control. The RAG is assimilating unstructured chunks, the KG is mapping the corpus. All done with human in the loop to guide the process.