How to Configure Graphify: A Complete Setup Guide for the Knowledge Graph Engine
Graphify is configured through three layers: running graphify install to register skills with your AI assistant, setting environment variables for backend LLM selection and behavior tuning, and creating a .graphifyignore file to exclude specific paths from the knowledge graph.
Graphify is a local knowledge-graph engine maintained in the Graphify-Labs/graphify repository that indexes code and optionally leverages LLMs for non-code assets. To configure Graphify effectively, you must understand its three-tier configuration system covering skill registration, environment variables, and file-based controls. The following guide explains how to set up each layer using the exact commands and file paths implemented in the source code.
Installation and Skill Registration
The graphify install command is the primary entry point for configuration. According to graphify/install.py, this command writes skill files that AI assistants require to interface with the graph, creating paths such as .claude/skills/graphify/SKILL.md or .agents/skills/graphify/SKILL.md.
By default, installation is global. Use the --project flag for repository-scoped installation, which writes skills into your project directory instead of user configuration folders. After execution, the CLI prints a git add hint to help you commit these definitions to version control.
Platform-Specific Installation
Run graphify install --platform <name> to generate assistant-specific configurations:
- Claude Code: Set
multi_agent = truein~/.codex/config.tomlto enable parallel extraction for large projects. - CodeBuddy: Automatically receives a
CODEBUDDY.mdsection and aPreToolUsehook. - Kilo Code: Installs a native
/graphifycommand and atool.execute.beforeplugin that forces the assistant to prefer the graph over raw source files.
Environment Variable Configuration
When running Graphify headlessly via graphify extract, you must supply authentication and backend selectors through environment variables. These variables are documented in the Environment variables section of README.md and control runtime behavior.
Critical variables include:
OPENAI_API_KEY: Authenticates requests when using the OpenAI backend.GRAPHIFY_BACKEND(or the--backendCLI flag): Selects the LLM provider. Valid values includeclaude,gemini, andollama.GRAPHIFY_MAX_GRAPH_BYTES: Overrides the default 512 MiB graph size limit. Example:export GRAPHIFY_MAX_GRAPH_BYTES=2GB.GRAPHIFY_QUERY_LOG_ENABLE: Set to1to enable local query logging for debugging.GRAPHIFY_HOOK_STRICT: Forces the assistant to always use the graph instead of falling back to raw source code browsing.
Relocating Output and Recovery
The GRAPHIFY_OUT variable allows you to customize the output directory location, while GRAPHIFY_REPO_ROOT assists in recovering from detached hook rebuild scenarios. These are particularly useful in CI/CD environments or when working with monorepos.
File-Based Controls
Graphify uses file-based configuration to fine-tune indexing behavior and output management.
Excluding Files with .graphifyignore
The .graphifyignore file functions identically to .gitignore, excluding specified files and directories from the knowledge graph. Patterns are evaluated after .gitignore rules, allowing you to layer exclusions specifically for Graphify. For example, exclude build artifacts and dependencies:
cat > .graphifyignore <<'EOF'
node_modules/
dist/
*.generated.py
EOF
Managing the Output Directory
The graphify-out/ directory contains the generated graph.json and graph.html. According to the source documentation, this directory should be committed to version control after the initial build. This allows subsequent developers to pull the pre-built graph and begin querying immediately using graphify query without waiting for a local extraction.
Building and Serving the Graph
Once configured, build the graph using CLI commands. For code-only indexing (no LLM required), use the --code-only flag:
# Build graph from current directory using static analysis only
graphify . --code-only
To process documentation with a specific backend like Ollama (requires no API key):
export OLLAMA_BASE_URL=http://localhost:11434
graphify extract ./docs --backend ollama
Enable strict mode to prevent the assistant from bypassing the graph, then reinstall the hooks:
export GRAPHIFY_HOOK_STRICT=1
graphify install --strict
To serve the graph via MCP HTTP for team-wide access, use the serve module implemented in the codebase:
python -m graphify.serve graphify-out/graph.json \
--transport http \
--host 0.0.0.0 \
--port 8080 \
--api-key "$SECRET"
Key Implementation Files
The following files control configuration behavior:
| File | Purpose |
|---|---|
graphify/install.py |
Implements graphify install, writes skill files and platform-specific hooks. |
graphify/watch.py |
Provides the graphify watch command and the hook that rebuilds the graph on each commit. |
graphify-out/GRAPH_REPORT.md |
Generated human-readable summary of the graph; verify that your configuration produced the expected nodes and edges. |
graphify-out/.graphify_python |
Stores the interpreter path used by the skill to avoid "module not found" errors across different environments. |
Summary
- Run
graphify installto generate skill files in.claude/skills/or.agents/skills/, using--projectfor repository-scoped configuration. - Set
GRAPHIFY_BACKENDto choose betweenclaude,gemini, orollama, and useOPENAI_API_KEYorOLLAMA_BASE_URLfor authentication. - Create
.graphifyignoreto exclude paths likenode_modules/from indexing, applying rules after.gitignore. - Commit the
graphify-out/directory after building to share the serialized graph with your team. - Enable
GRAPHIFY_HOOK_STRICT=1to force AI assistants to always use the knowledge graph instead of raw source.
Frequently Asked Questions
How do I install Graphify for a specific project only?
Use the --project flag with graphify install. This writes skill files to .claude/skills/graphify/SKILL.md (or the equivalent path for your selected platform) within your repository rather than installing globally. Project-scoped installation keeps configuration version-controlled and ensures teammates use identical skill definitions.
What is the difference between --code-only and using an LLM backend?
The --code-only flag builds the graph using static analysis of your code files without calling external APIs, requiring no API keys and completing faster. Using an LLM backend via --backend claude or --backend ollama enables Graphify to extract semantic information from non-code assets like PDFs and documentation by processing them through the language model.
How do I prevent Graphify from indexing certain files?
Create a .graphifyignore file at your repository root and add glob patterns following the same syntax as .gitignore. These patterns are applied after .gitignore rules, allowing precise control over which files enter the knowledge graph. Exclude directories like node_modules/ or generated files like *.generated.py to keep the graph size optimized.
Why should I commit the graphify-out/ directory?
The graphify-out/ directory contains graph.json, the serialized knowledge graph, along with GRAPH_REPORT.md summarizing its contents. Committing this directory allows teammates to pull the pre-built graph and start querying immediately using graphify query or graphify path without waiting for local extraction. Subsequent developers only need to run graphify watch to keep the graph synchronized with code changes.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →