Vector search is good at semantics but weak at exact identifiers; keyword search is the opposite. GraphRAG promises a third signal — structure: if the query mentions an entity, chunks connected to that entity's neighborhood should rank higher even when the words don't match. I wanted to test that claim with the smallest possible honest implementation, so every design decision is visible.
python -m graphrag.cli index <dir> / query "..." / stats$ python -m graphrag.cli index examples/corpus
14 chunks, 50 entities, 38 relations -> graphrag.db
$ python -m unittest tests.test_pipeline
Ran 8 tests — OK # incl. test_graph_expansion_changes_ranking:
# graph_weight 0 vs 0.9 measurably reorders results
Zero dependencies — stdlib only. That was deliberate: a clean-room demo where the retrieval math is auditable line by line.
The entity extractor is regex-based and emits noise; relations are undirected co-mentions, not typed edges; there are no embeddings. This is a structural baseline to compare against — the README's "verified vs prototype" section says exactly that.