Local-first project knowledge graph CLI
Project description
Grapheinstein
Local-first CLI that maps a project folder into a portable graph.json knowledge graph for AI agents.
Offline by design — indexing, explain, path, and query use the local filesystem and optional local models (e.g. Ollama). No cloud APIs required.
Schema version: 6.0.0.
Install
pip install grapheinstein
# Optional local HTTP API:
# pip install 'grapheinstein[serve]'
# Optional OCR / audio extras:
# pip install 'grapheinstein[media]'
From source
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Optional local HTTP API:
# pip install -e ".[dev,serve]"
Quick start
# Create a commented starter config (~/.grapheinstein/config.yaml by default)
grapheinstein init
# or: grapheinstein init --output ./grapheinstein.yaml
# Index a project (default command)
grapheinstein /path/to/project --output graph.json
# Explicit index with project config
grapheinstein index /path/to/project -o graph.json --config ./grapheinstein.yaml
# Explain / path / query over an existing graph
grapheinstein explain "authentication" -i graph.json -o explain.json --no-summary
grapheinstein path "login" "database" -i graph.json --no-llm-explain
grapheinstein query "How does auth work?" -i graph.json -o sub.json --no-answer
# Console summary / status
grapheinstein visualize --input graph.json
grapheinstein status --output graph.json
# Optional local HTTP (requires: pip install 'grapheinstein[serve]')
grapheinstein serve --port 8000
Agent integration
Agents and Cursor slash-commands should call the Python API (same semantics as the CLI):
from grapheinstein.api import index, query
Optional HTTP: POST /index and POST /query via grapheinstein serve (loopback by default).
See docs/agent-integration.md for copy-paste examples and CLI ↔ Python ↔ HTTP parity.
Configuration
Config precedence: CLI flags > --config file > ~/.grapheinstein/config.yaml > built-ins.
Key settings (see grapheinstein init for a full commented template):
| Key | Purpose |
|---|---|
ignored_patterns |
Extra gitignore-style paths beyond .gitignore |
embedding_model |
Local model for embeddings |
llm_model |
Local model for enrichment / answers |
max_file_size |
Skip parsing files larger than this (bytes; default 10 MiB) |
cache_dir |
Local cache for ASTs / chunks / embeddings (default ~/.grapheinstein/cache) |
Re-indexing an unchanged project reuses the cache under cache_dir for faster runs.
Validation
pytest
ruff check src tests
Feature quickstarts live under specs/*/quickstart.md (e.g. specs/011-config-cache-init/quickstart.md).
Contributing
Community contributions are welcome — bug fixes, docs, tests, and features that fit the project’s local-first CLI goals.
See CONTRIBUTING.md for setup, validation, and how to propose a change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grapheinstein-0.2.0.tar.gz.
File metadata
- Download URL: grapheinstein-0.2.0.tar.gz
- Upload date:
- Size: 75.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69321ff4fcc6aada569379bf7768c3bd6dee6abff4bc97341ce32da88989c022
|
|
| MD5 |
a2e4acae4f1dcfea1f14aa54b5969922
|
|
| BLAKE2b-256 |
64811c10dac03cbb59a3c70322bd8319e21b65877fd7ee9114e582d0f307c10c
|
Provenance
The following attestation bundles were made for grapheinstein-0.2.0.tar.gz:
Publisher:
publish.yml on Joezanini/grapheinstein
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grapheinstein-0.2.0.tar.gz -
Subject digest:
69321ff4fcc6aada569379bf7768c3bd6dee6abff4bc97341ce32da88989c022 - Sigstore transparency entry: 2201438893
- Sigstore integration time:
-
Permalink:
Joezanini/grapheinstein@e7d1a1fd1ddd46ea6b0112b9dabf49ae3b27201e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Joezanini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7d1a1fd1ddd46ea6b0112b9dabf49ae3b27201e -
Trigger Event:
push
-
Statement type:
File details
Details for the file grapheinstein-0.2.0-py3-none-any.whl.
File metadata
- Download URL: grapheinstein-0.2.0-py3-none-any.whl
- Upload date:
- Size: 89.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41c42996498f53275deb5137a0d8bbc845e80336099a274da7be95a3abcdedad
|
|
| MD5 |
3dbca1c177cb04b8d9fff6d386164110
|
|
| BLAKE2b-256 |
852b693a6e430a34b95f9ec904be8bf9ace77f7da2679e669ae9fbcea92fe8f2
|
Provenance
The following attestation bundles were made for grapheinstein-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Joezanini/grapheinstein
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grapheinstein-0.2.0-py3-none-any.whl -
Subject digest:
41c42996498f53275deb5137a0d8bbc845e80336099a274da7be95a3abcdedad - Sigstore transparency entry: 2201439045
- Sigstore integration time:
-
Permalink:
Joezanini/grapheinstein@e7d1a1fd1ddd46ea6b0112b9dabf49ae3b27201e -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Joezanini
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e7d1a1fd1ddd46ea6b0112b9dabf49ae3b27201e -
Trigger Event:
push
-
Statement type: