A local code knowledge graph that gives AI coding tools precise review context over MCP and a CLI.
punnerud/Local_Knowledge_Graph
A local reasoning tool where a small model's step-by-step answers are stored as a knowledge graph, all running on your own machine via Ollama.
- Stars
- 584
- Forks
- 51
- Open issues
- 1
- Last commit
- 2 months ago
What is it?
Local Knowledge Graph runs a local language model through Ollama and asks it to reason step by step. Each run's reasoning is recorded as a knowledge graph, and the graph is used in the answering process rather than only being displayed. A web interface at localhost:5100 starts jobs and shows what dependencies are missing.
The project offers three modes: reason, which answers in a single run; explore, which answers each sub-question with its own run; and settle, which finishes only when two independent runs agree. Any run can be exported as RDF through a JSON API. The project's docs cover model selection and configuration, and the project reports measured accuracy differences between models on an arithmetic test set.
The project is installable from PyPI as mpe-lkg and is tested on Linux, macOS and Windows. It is released under the mpedb License 1.0, which is free for most users but charges a fee for very large organizations and is not OSI-approved.
Key features
- 01Runs a local model through Ollama, with no data sent to external services.
- 02Stores step-by-step reasoning as a knowledge graph that feeds back into answers.
- 03Offers reason, explore and settle modes for increasingly careful answering.
- 04Exports any run as RDF via a simple HTTP API.
- 05Installs from PyPI and runs on Linux, macOS and Windows.
Use cases
- Answering multi-step arithmetic or reasoning questions with a locally hosted model.
- Experimenting with how knowledge graphs can support small language model reasoning.
- Exporting model reasoning traces as RDF for downstream semantic-web tooling.
Topics
FAQ
- What is Local_Knowledge_Graph?
- A local reasoning tool where a small model's step-by-step answers are stored as a knowledge graph, all running on your own machine via Ollama. Local Knowledge Graph runs a local language model through Ollama and asks it to reason step by step. Each run's reasoning is recorded as a knowledge graph, and the graph is used in the answering process rather than only being displayed. A web interface at localhost:5100 starts jobs and shows what dependencies are missing.
- Is Local_Knowledge_Graph free to use? What license does it have?
- Local_Knowledge_Graph is open source under the Other license. Check the license terms before using it in commercial products.
- Is Local_Knowledge_Graph still maintained?
- Updated within 6 months. The last commit to Local_Knowledge_Graph was on Aug 13, 2026.
- What can I use Local_Knowledge_Graph for?
- Answering multi-step arithmetic or reasoning questions with a locally hosted model. Experimenting with how knowledge graphs can support small language model reasoning. Exporting model reasoning traces as RDF for downstream semantic-web tooling.
- Where can I get Local_Knowledge_Graph?
- The source code and installation instructions are on GitHub: https://github.com/punnerud/Local_Knowledge_Graph
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Python library that uses LLMs and graph-based pipelines to extract structured data from websites and local documents based on a natural-language prompt.
Open-source, local-first AI meeting assistant that records, transcribes in real time, and generates summaries on macOS and Windows.
AutoGPT is an open-source platform for building, running, and scheduling AI agents that complete multi-step workflows from plain-English descriptions or a visual builder.
Open-source Python library for AI browser agents that let an LLM operate a real browser, with an optional hosted cloud browser and agent API.
An all-in-one AI app for chatting with your documents and running AI agents, with local-first LLM support, multi-user access and no-code agent building.