Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,26 @@
pypi.org, where a relative path resolves against pypi.org and 404s. -->
![Example](https://raw.githubusercontent.com/punnerud/Local_Knowledge_Graph/main/docs/example.png)

Ask a local model a question, watch it reason step by step, and see the steps drawn as a
graph. **Blue** edges are embedding similarity — association. **Green** is what an exact
evaluator settled — sums and unit conversions, in fractions, via
[mpeqs](https://github.com/punnerud/MPEqs). Everything runs on your machine.
Ask a local model a question, watch it reason step by step — and see the reasoning as a
knowledge graph that is **used, not just drawn**. **Blue** edges are embedding similarity —
association. **Green** is what an exact evaluator settled — sums and unit conversions, in
fractions, via [mpeqs](https://github.com/punnerud/MPEqs). Everything runs on your machine.

## The graph is load-bearing

Every claim below is a measurement pinned in `docs/claims/` and re-checked by CI on every
push — the numbers cannot drift from the code.

| what the graph does | measured |
|---|---|
| **writes the answer**: the strongest path through the steps is what the final answer is synthesised from | 54.9% → **91.2%** correct on the eval that motivated it |
| **steers exploration**: sub-questions that drift from the parent, or repeat one already asked, are dropped by embedding — decisions the model cannot make about itself | drift and repeats filtered in `explore`/`settle`, tested |
| **gates the answer type**: whether a numeric answer is even on the table is an embedding-relevance decision made by code, not by the model | the model chose a number for "capital of France" 3/3 without it |
| **hands arithmetic to [mpeqs](https://github.com/punnerud/MPEqs)**: expressions and unit conversions settle exactly, off the graph's facts | **+32.5 points** where arithmetic is the task, 95% CI [+15.3, +49.7], replicated |
| **accumulates knowledge**: every run lands in per-session SQL tables and RDF, queryable across time | sessions isolated, hints opt-in, `GET /sessions` |

Not a general knowledge-graph-builder for documents or RAG: the graph here is built *from
the model's own reasoning* and fed back into it.

## Run it

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "mpe-lkg"
version = "0.8.0"
description = "Local Knowledge Graph: a local LLM reasons step by step, and the steps become a graph."
description = "Local Knowledge Graph: a local LLM reasons step by step, and the graph writes, steers and checks the answer."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
Expand Down
Loading