Overview
Using network topology (Leiden/Louvain) to discover the latent topical neighbourhoods hiding inside a chaotic entity graph.
Why it matters
Once entity extraction has produced thousands of nodes and edges, the graph is just as overwhelming as an unindexed pile of documents — unless you can see its shape. Community detection algorithms (most commonly Louvain or its more stable successor Leiden) solve this by analysing the graph's topology alone — not the text, just which nodes connect to which — and finding clusters of entities that are densely connected to each other but only sparsely connected to the rest of the graph.
Concretely: if Acme, Widgetco, and three of their executives all link to each other through acquired, worksAt, and foundedBy edges, but rarely connect to entities in an unrelated Healthcare Regulation cluster, the algorithm groups the first five nodes into one community and leaves the second group separate — without ever having 'read' what the documents were about.
This matters for retrieval because communities become the unit for the next lesson's hierarchical summaries: instead of the LLM trying to reason over 10,000 raw nodes, it can reason over a much smaller number of pre-summarised topical clusters, then drill into the specific community relevant to a query. Community detection is what turns 'a big tangled graph' into 'an organised map of the corpus's actual subject areas.'
