Skip to main content

Local Knowledge Graph

Linux macOS Windows PyPI Python

Example

Ask a local model a question, watch it reason step by step, and see the steps drawn as a graph where the edges are how similar the steps are to each other.

The run starts by breaking the question into angles worth checking, then works through them — about eight steps, each with a named job rather than a quota to fill. Any arithmetic a step relies on is handed over as an expression and evaluated exactly, in fractions, by mpeqs. Those sums are shown above the graph: they are the one part of a run the model did not decide, and you can check 20-13.5 = 6.5 at a glance in a way you cannot check a paragraph of reasoning.

Everything runs on your machine. Nothing is uploaded anywhere.

Run it

pip install mpe-lkg
mpe-lkg

Then open http://localhost:5100.

It needs a local model, which it reaches through Ollama. You do not need to work that out from here — start it and it will tell you what it found, what is missing, and the one command that fixes it. mpe-lkg doctor reports the same thing without starting the server, and exits non-zero, so it works in a script.

Python 3.10 or newer. The wheel is py3-none-any, so nothing is compiled and the same artefact serves Linux, macOS and Windows — all three tested on every push.

From a clone, or from Python
git clone https://github.com/punnerud/Local_Knowledge_Graph
cd Local_Knowledge_Graph
python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/mpe-lkg

python app.py still works from a clone as it always has.

from mpe_lkg import create_app, health

print(health())
create_app().run(port=5100)

More

Models and configuration Choosing models, every environment variable, troubleshooting
Embeddings from inside a model Reading a chosen layer instead of an embedding endpoint
How it works The modules, the strongest-path search, why there is no ANN index
Development Tests, and the gate that checks this documentation against measured data

Licence

The mpedb License 1.0 — the same licence as mpedb and MPEqs, byte for byte.

Free of charge for every person and every organization, with one exception: a group whose revenue or valuation exceeds five billion dollars owes a one-time fee of seven US cents per device. Not an OSI-approved licence.


Published to PyPI as mpe-lkgMorten Punnerud-Engelstad Local Knowledge Graph.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpe_lkg-0.5.0.tar.gz (704.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpe_lkg-0.5.0-py3-none-any.whl (235.8 kB view details)

Uploaded Python 3

File details

Details for the file mpe_lkg-0.5.0.tar.gz.

File metadata

  • Download URL: mpe_lkg-0.5.0.tar.gz
  • Upload date:
  • Size: 704.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for mpe_lkg-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d19192fb110991d496e5c1f1165ef4b06bfefd33cb79db24561b0c562b695dae
MD5 b657cdc9acdd95d91dcc5728cd1b6f4c
BLAKE2b-256 ac2af5e3cad49ec37eb7bc3e9137b6b7421689f5576e981ce0ea922d24e173fa

See more details on using hashes here.

File details

Details for the file mpe_lkg-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: mpe_lkg-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 235.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.12

File hashes

Hashes for mpe_lkg-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0080b51d5d4bf955b7ffeb19fd6168974950c0a1acfdaaf9eb844ed6326cd943
MD5 7f9dbf8adbd75fb8d8250da6f8f36a72
BLAKE2b-256 d4588c642bb70870a577933c36e4802a727b527a1ba2601fedc880c7d881589a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page