I am using LLM to create knowledge graph from a document.
Even when I am using the same document to create the graph, I am getting newer nodes and relationships each time, even though no meaning has changed.
How can I get deterministic graph from the document?
You are using an LLM. That is inherently non-deterministic. If you were to run it locally you might be able to set it up with special torch settings to have it be more deterministic (ref GitHub - ni-eck/deterministic-llm-inference · GitHub ) but even then there seems to be a 0.1% chance for non determinism.
If pretty close to deterministic is enough, keep your temperature 0 and set those other parameters (top_p, frequency_penalty ...) to the deterministic values, you can find that via a simple google search though.
Oh wow, i just realized this is almost a year old.