Skip to main content

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


Download files

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

Source Distribution

grapheinstein-0.2.0.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

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

grapheinstein-0.2.0-py3-none-any.whl (89.6 kB view details)

Uploaded Python 3

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

Hashes for grapheinstein-0.2.0.tar.gz
Algorithm Hash digest
SHA256 69321ff4fcc6aada569379bf7768c3bd6dee6abff4bc97341ce32da88989c022
MD5 a2e4acae4f1dcfea1f14aa54b5969922
BLAKE2b-256 64811c10dac03cbb59a3c70322bd8319e21b65877fd7ee9114e582d0f307c10c

See more details on using hashes here.

Provenance

The following attestation bundles were made for grapheinstein-0.2.0.tar.gz:

Publisher: publish.yml on Joezanini/grapheinstein

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for grapheinstein-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41c42996498f53275deb5137a0d8bbc845e80336099a274da7be95a3abcdedad
MD5 3dbca1c177cb04b8d9fff6d386164110
BLAKE2b-256 852b693a6e430a34b95f9ec904be8bf9ace77f7da2679e669ae9fbcea92fe8f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for grapheinstein-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Joezanini/grapheinstein

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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