graphify icon indicating copy to clipboard operation
graphify copied to clipboard

Graph.json inconsistency for same data across multiple runs

Open umeshpsatwe opened this issue 4 months ago • 2 comments

We are using this on documents. The resultant graph is not consistent across different runs. Ex, if I run Graphify on 50 documents multiple times, the nodes and edges are not consistent in graph.json. Has anyone encountered this and found a solution ?

umeshpsatwe avatar Jul 03 '26 17:07 umeshpsatwe

What backend do you use and exact model name?

sub4biz avatar Jul 03 '26 18:07 sub4biz

Partially fixed in e2ef4ef (on v8, ships in 0.9.6).

There were two layers here. The pipeline layer was a real bug: with a parallel LLM backend, chunk results were merged in completion order, so which network call happened to return first reordered nodes and edges run-to-run even when the model returned identical content. Chunks are now merged in deterministic submission order after the pool drains, so that source of churn is gone. (Clustering and code extraction were already deterministic - verified byte-identical graph.json across repeated code-only runs.)

The remaining layer is not something graphify can fully eliminate: for documents, the semantic content itself is produced by the LLM, which is nondeterministic run-to-run (even at temperature 0, and especially for local models under load). So node/edge ordering is now stable, but the set of extracted concepts can still vary with the model. If you want maximum stability, the semantic cache (content-hash-keyed) keeps unchanged documents identical across runs, and pinning a deterministic backend/model helps. Closing on the pipeline fix - please reopen if you see ordering churn on an unchanged corpus after 0.9.6.

safishamsi avatar Jul 04 '26 02:07 safishamsi