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. Blue edges are embedding similarity — association. Green is what an exact evaluator settled — sums and unit conversions, in fractions, via mpeqs. Everything runs on your machine.

Run it

pip install mpe-lkg
mpe-lkg

Open http://localhost:5100. It talks to a local model through Ollama and will tell you what is missing and the one command that fixes it. The model matters more than anything else here — measured, qwen3:4b-instruct-2507 answers 82.5% of the arithmetic battery against llama3.2:3b's 40%:

ollama pull qwen3:4b-instruct-2507-q4_K_M

Ask harder questions with mode=explore (each sub-question answered by its own run) or mode=settle (explored twice, finished only when two independent runs agree), and take any run as RDF:

curl -sX POST localhost:5100/jobs -H 'content-type: application/json' \
     -d '{"query":"How many seconds are there in 23 weeks?","mode":"settle"}'
curl -s localhost:5100/jobs/<id>/rdf

More

Modes, jobs and RDF reason / explore / settle, the vote, the probes, the vocabulary
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.8.0.tar.gz (778.1 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.8.0-py3-none-any.whl (283.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpe_lkg-0.8.0.tar.gz
  • Upload date:
  • Size: 778.1 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.8.0.tar.gz
Algorithm Hash digest
SHA256 0bdc7260ce64a464061808b7083f9b7c2f91883eccfd32cc8511e28ef48d7014
MD5 4392148a9431d9cbc9f212fb91e74b28
BLAKE2b-256 6edad93635b10b99174deaaea996f5602b4baa48150b8d0eb1b662fb5cc2d3b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpe_lkg-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 283.4 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.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f7d5b26067db2d470e33d395c398d6dd36af698bb9f67752e7ec5a204ddf8bc
MD5 79cd3a682138d11704ecdbcf32111a19
BLAKE2b-256 07d0c4e2d5267e5305669f3f1007924733b4a6bf13ca68bdb4122d5e13ed0ccc

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 Sentry Error logging StatusPage Status page