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.1.0.tar.gz (70.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.1.0-py3-none-any.whl (83.9 kB view details)

Uploaded Python 3

File details

Details for the file grapheinstein-0.1.0.tar.gz.

File metadata

  • Download URL: grapheinstein-0.1.0.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for grapheinstein-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a70e0560eeb0aafbb5840a444b6fc9b51f6eff12d3c574262573f170ee77cb4
MD5 768aa8d3fce2f99a30c88da83cd85da7
BLAKE2b-256 61b9abb17dc7c9c680ced4265970dc345d1865e31e07e616c5348d1e4cdcb6a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for grapheinstein-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: grapheinstein-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 83.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for grapheinstein-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0029300ed3b8af56c5b12a1a8e10eb19a29b08deac66520bb6f8f10c3a9a6b7
MD5 fa36a7453a0a346c1c0f876d0327a36a
BLAKE2b-256 4dfb1c8a39f8d03ae634fda9d14f14f6711508919bb09f88b08d95457ed843ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for grapheinstein-0.1.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