Integration Guide
Guide to integrating NeuralMind with MCP tools, graphify, and other development workflows.
Table of Contents
- How Agents Share Memory (v0.6.0+)
- Graphify Integration
- MCP Integration
- Claude Desktop
- Cursor
- Hermes-Agent — the plugin for context in every turn (v4.9.0+), then MCP and the skill
- Agent Zero
- OpenClaw
- Custom MCP Clients
- CI/CD Integration
- IDE Integration
- Scripting Integration
How Agents Share Memory (v0.6.0+)
NeuralMind is the shared associative memory layer underneath whatever AI coding tools you use. If you run Claude Code for the day-to-day, Cursor for inline completions, OpenClaw for one-offs, and Hermes-Agent for planning — they all reinforce the same brain, and v0.6.0 makes the union of their activity visible.
The shared substrate
These pieces of local state belong to the project, not to any one agent:
| Path | What it is | Who reads/writes |
|---|---|---|
graphify-out/graph.json |
Call graph (created by graphify) |
Read-only at NeuralMind runtime |
graphify-out/neuralmind_db/ |
ChromaDB vector index | neuralmind build writes; agents read |
<project>/.neuralmind/synapses.db |
Learned synapse weights | Every MCP tool call, every watch event, every Claude Code hook, and (v4.9.0+) the Hermes plugin |
<project>/.neuralmind/events.jsonl (v0.6.0+) |
Cross-process activity stream | Every event_bus.publish() writes; serve tails |
<project>/.neuralmind/recaps/ (v4.8.0+) |
Session recap records: each session’s prompts and edited files | Claude Code’s hooks and the Hermes plugin write; a new session in either starts with the most recent one’s recap |
There’s no per-agent partition. Claude Code’s neuralmind_query
and Hermes-Agent’s neuralmind_query reinforce the exact same
synapse edges. The brain is one brain. Since v4.9.0 the same holds for
the session recap: a Hermes session (with the plugin) can start with what
the last Claude Code session in the project did, and the other way round.
Verifying the shared-brain setup
The launch spec is not what scopes the server to a project.
neuralmind-mcp takes no arguments — every MCP tool carries its own
project_path, resolved against the server process’s working directory. So
register it bare in every host, and make the shared brain by passing the same
absolute project path on each call:
# In each agent's host (Claude Desktop, Hermes, OpenClaw, etc.),
# the server is registered with NO arguments:
neuralmind-mcp
# What makes it one brain is the per-call argument, identical everywhere:
# neuralmind_query(project_path="/absolute/path/to/project", question="…")
# Verify the agent connected:
hermes mcp test neuralmind # if using Hermes
openclaw mcp show neuralmind # if using OpenClaw
# Verify the synapse store is at the expected path:
neuralmind stats .
# Pop the live canvas:
neuralmind serve .
Then trigger a tool call from each agent. The corresponding nodes should pulse on the v0.6.0 canvas regardless of which agent originated the call. If only some agents pulse, check that they’re pointing at the same project root (most common bug: relative paths that resolve differently in different processes — always use absolute paths in MCP host configs).
Why this didn’t work pre-v0.6.0
The synapse store was already shared, but the experience wasn’t.
Each agent talked to the same SQLite file but you had no way to see
the union of their activity — three tools talking to a black box.
The v0.6.0 JSONL bridge (event_log.py)
solved this by routing every event_bus.publish() through a
shared file that serve can tail. Same SQLite, plus a visible
heartbeat.
See docs/use-cases/multi-agent.md for a two-week walkthrough.
Opt-out
NEURALMIND_EVENT_LOG=0 disables the JSONL writer in the process
where it’s set. The in-process bus is unaffected — serve still
pulses for its own activity, just not for activity from other
processes.
Graphify Integration
NeuralMind generates its own code graph — neuralmind build uses the built-in tree-sitter backend (ten languages), so no external install is required. graphify (Apache-2.0; originally by Safi Shamsi, now under the Graphify-Labs org) is an optional alternative graph producer: it analyzes a corpus (code, docs, papers, images) into a richer structured graph, and where a graphify-generated graph.json is present it takes priority automatically.
Installing Graphify
Optional since v0.15.0 —
neuralmind buildgenerates the code graph itself via the built-in tree-sitter backend (Python, TypeScript, Go). Install graphify only if you want its richer graph or broader language coverage; it takes priority automatically.
pip install graphifyy
Generating Knowledge Graph
# Navigate to your project
cd /path/to/your/project
# Generate knowledge graph
graphify update .
# This creates:
# - graphify-out/graph.json (knowledge graph)
# - graphify-out/GRAPH_REPORT.md (analysis report)
# - graphify-out/cache/ (processing cache)
Understanding graph.json
The knowledge graph contains:
{
"nodes": [
{
"id": "unique_id",
"name": "authenticate_user",
"type": "function",
"file_path": "auth/handlers.py",
"description": "Validates user credentials",
"community": 5
}
],
"edges": [
{
"source": "node_id_1",
"target": "node_id_2",
"type": "calls"
}
],
"communities": [
{
"id": 5,
"name": "Authentication",
"description": "User authentication and authorization"
}
]
}
Keeping Graph Updated
Update the graph when code changes:
# Rebuild the NeuralMind index (the code graph is regenerated
# automatically; on the graphify backend, run graphify update first)
neuralmind build /path/to/project
Git Hook for Automatic Updates
Add to .git/hooks/post-commit:
#!/bin/bash
# Automatically update knowledge graph after commits
PROJECT_ROOT=$(git rev-parse --show-toplevel)
# Rebuild NeuralMind index (regenerates the code graph)
neuralmind build "$PROJECT_ROOT" 2>/dev/null
Make it executable:
chmod +x .git/hooks/post-commit
MCP Integration
NeuralMind includes a Model Context Protocol (MCP) server for seamless integration with AI coding assistants.
MCP Server Overview
The MCP server exposes NeuralMind’s functionality as tools that AI assistants can call:
| Tool | Description |
|---|---|
neuralmind_wakeup |
Get wake-up context for a project |
neuralmind_query |
Query project with natural language |
neuralmind_search |
Semantic search across codebase |
neuralmind_skeleton |
Graph-backed file view |
neuralmind_recursive_query |
Decompose and explore complex questions |
neuralmind_query_docs |
Search reference documents (PDFs, DOCX) |
neuralmind_build |
Build/rebuild neural index |
neuralmind_stats |
Get project statistics |
neuralmind_benchmark |
Run performance benchmark |
neuralmind_synaptic_neighbors (v0.4.0) |
Spreading-activation recall over the learned synapse graph; complements vector search with usage-based recall |
neuralmind_synapse_stats (v0.4.0) |
Inspect the synapse graph: edges, LTP edges, top hubs, total weight |
neuralmind_synapse_decay (v0.4.0) |
Manually run a decay tick (normally fired automatically by the SessionStart hook) |
neuralmind_export_synapse_memory (v0.4.0) |
Render the synapse graph as markdown and write it to project-local memory + Claude Code’s auto-memory directory when present |
Starting the MCP Server
# Using the CLI entry point
neuralmind-mcp
# Or as a Python module
python -m neuralmind.mcp_server
# With custom port (if supported)
neuralmind-mcp --port 8080
Claude Desktop
Claude Desktop supports MCP servers natively.
Configuration
- Find your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
- Add NeuralMind server:
{
"mcpServers": {
"neuralmind": {
"command": "neuralmind-mcp",
"args": [],
"env": {}
}
}
}
- Restart Claude Desktop
Using with Claude
Once configured, Claude can:
User: What does the authentication module do in /projects/myapp?
Claude: [Calls neuralmind_query with project_path and question]
Based on the codebase analysis, the authentication module...
Virtual Environment Configuration
If NeuralMind is installed in a virtual environment:
{
"mcpServers": {
"neuralmind": {
"command": "/path/to/venv/bin/neuralmind-mcp",
"args": [],
"env": {
"VIRTUAL_ENV": "/path/to/venv"
}
}
}
}
Cursor
Cursor IDE supports MCP through its AI features.
Configuration
- Open Cursor Settings
- Navigate to AI → MCP Servers
- Add server configuration:
{
"neuralmind": {
"command": "neuralmind-mcp"
}
}
Workspace-Specific Setup
Create .cursor/mcp.json in your project:
{
"mcpServers": {
"neuralmind": {
"command": "neuralmind-mcp"
}
}
}
The server takes no project setting: each tool call carries its own
project_path (see Verifying the shared-brain setup).
Hermes-Agent
Hermes has two ways in, and they do different jobs:
- The NeuralMind plugin (v4.9.0+) adds NeuralMind’s context to every turn before the model runs, with no tool call, the way NeuralMind’s Claude Code hooks do.
- The MCP server, or the skill, lets the agent call NeuralMind when it decides to: a query, a file skeleton, a rebuild.
They work together. The plugin covers what every turn needs; the tools are there when the agent wants more.
The NeuralMind plugin: context in every turn (v4.9.0+)
Through MCP or the skill alone, each answer from NeuralMind costs a tool call, and when the agent doesn’t think to make one, nothing happens. The plugin removes that step.
neuralmind build /absolute/path/to/repo
neuralmind install-hermes-plugin /absolute/path/to/repo
The command writes the plugin into the Hermes home’s plugins/neuralmind/:
the one plain hermes uses: the active Hermes profile’s home, if
hermes profile use selected one (<root>/profiles/<name>), else
$HERMES_HOME, else Hermes’s root home, ~/.hermes (on Windows, %LOCALAPPDATA%\hermes). The output names the
profile when it installs into one; pass any other home with --hermes-home.
The files are __init__.py, the plugin.yaml manifest Hermes discovers it by,
and a config.json holding the project and the Python interpreter that ran the
install. The command then runs hermes plugins enable neuralmind against that
same home, since Hermes loads a user plugin only once it’s enabled, but only
in a home Hermes has already set up (one with a config.yaml, .env or
state.db); anywhere else it tells you to enable the plugin once Hermes is set
up. Start a new Hermes session, or restart the gateway, to load it.
The installed plugin is a copy: pip install -U neuralmind doesn’t update it,
so re-run neuralmind install-hermes-plugin after upgrading NeuralMind. A
re-run doesn’t re-enable a plugin you turned off with
hermes plugins disable neuralmind: it says so and leaves it disabled.
(v4.10.0+) Hermes can also install the plugin itself, from a clone of this repository:
hermes plugins install dfrostar/neuralmind#neuralmind/hermes_plugin --enable
Then Hermes owns the code (hermes plugins update neuralmind updates it), and
the plugin runs the neuralmind command on Hermes’s PATH. Where Hermes’s PATH
doesn’t include it (a gateway run as a service, Hermes Desktop), also run
neuralmind install-hermes-plugin: on a plugin Hermes installed, it writes only
the interpreter and the project, and leaves the code alone. The plugin’s
README
lists what it reads, writes and sends.
What it does:
| When (Hermes hook) | What the agent gets, or what’s recorded |
|---|---|
Every turn, before the model runs (pre_llm_call) |
The files and recorded decisions related to the user’s message, the same block Claude Code’s UserPromptSubmit hook adds. Hermes appends it to that turn’s user message, not to the system prompt, so the prompt cache isn’t invalidated. |
| A session’s first turn (same hook) | The session recap of the previous session in the project, ahead of the block above. Hermes counts a turn as first only when the session has no earlier messages, so a resumed session doesn’t get it. |
After write_file or patch (post_tool_call) |
The edited file is recorded, by the absolute path Hermes reports (files_modified), on a background thread, for the next session’s recap and the synapse layer. A V4A patch records each file it touches, except a file it deletes, which isn’t listed as edited. Only an edit that landed (Hermes’s status ok) is recorded: a cancelled, timed-out, blocked or failed one isn’t, and neither is a file changed through the terminal tool. |
- Subagents and cron jobs are skipped. A subagent’s message is written by
its parent agent, and a cron job (Hermes’s
cronplatform) runs on a schedule. For both, the prompt is neither recorded nor answered with recall, theSessionStartaction doesn’t run, and their edits aren’t recorded. - One record for both agents. Hermes and Claude Code write to the same
.neuralmind/recaps/, so a Hermes session can start with what the last Claude Code session in the project did, and the other way round. - Same switches as the Claude Code hooks. The plugin is a small
stdlib-only file. Each action runs
neuralmind _hook <action>with the interpreter recorded at install, else (v4.10.0+) theneuralmindcommand on Hermes’s PATH, so NeuralMind doesn’t have to be installed in Hermes’s own environment, and Hermes’sPYTHONPATHandVIRTUAL_ENVaren’t passed on to it. Set in Hermes’s environment,NEURALMIND_BYPASS=1turns every action off,NEURALMIND_SYNAPSE_INJECT=0drops the related files, andNEURALMIND_SESSION_RECAP=0stops recording and the recap.
Which project a Hermes session belongs to
NEURALMIND_PROJECTin Hermes’s environment, if set (only this plugin reads it);- else the path given to
install-hermes-plugin; - else Hermes’s terminal working directory (
TERMINAL_CWD); - else, only when
TERMINAL_CWDisn’t set, the directory Hermes runs in.
The first of these where neuralmind build has run wins; if none has, the
plugin does nothing. Install with a path and the command warns if that project
isn’t built yet.
The plugin reads TERMINAL_CWD from the Hermes process’s environment, which
matches where the terminal CLI and a standalone gateway work. Hermes Desktop,
ACP editor sessions and per-session workspaces keep each session’s directory
elsewhere, so there, pin a project or set NEURALMIND_PROJECT.
A pin applies to every Hermes session that uses that Hermes home, whatever
directory it runs in: each one gets the pinned project’s context, and its
prompts are recorded in that project. Sessions in other repositories also put
their edited files’ paths into the pinned project’s synapse store, from where
neuralmind memory publish can carry them
into the committed team-memory bundle. If you use Hermes across several
projects, install without a path, so the plugin follows the directory Hermes
works in and does nothing in a repository NeuralMind hasn’t built. Re-running
the install without a path keeps an earlier pin; --unpin clears it.
A gateway session (Telegram, Discord …) uses the gateway’s terminal working
directory (terminal.cwd, else MESSAGING_CWD, else your home directory),
which is rarely the project you mean, so pin one at install or set
NEURALMIND_PROJECT. Whenever a gateway session resolves to a built project,
pinned or not, every message in it is recorded for the recap. Messages pass
through the same credential redaction as any other prompt, which catches
common credential formats, not every secret; NEURALMIND_SESSION_RECAP=0
turns the recording off.
Limits
- One subprocess per turn (two on a session’s first turn: the recap, then
recall), plus one per edited file. Each waits at most
NEURALMIND_HERMES_TIMEOUTseconds (default8), so a first turn can wait up to twice that. One that times out or fails is left out, and the turn goes ahead with whatever context the others returned. Keep twiceNEURALMIND_HERMES_TIMEOUTbelow Hermes’splugins.hook_callback_timeout(default 30 s): if the plugin runs past it, Hermes drops the whole block and skips the plugin’s per-turn hook for the next 60 seconds. (v4.10.0+) When it can’t start NeuralMind, finds one older than 4.9 (which answers without the recap), or a call times out, the plugin logs one warning per Hermes process naming the fix:hermes logs --level WARNING | grep -i neuralmind. - The context stays in Hermes’s session history. Hermes stores the turn’s message with NeuralMind’s block in it, so the block, recap included, is sent to your model provider again with that session’s later turns.
- On a session’s first turn the plugin runs NeuralMind’s whole
SessionStartaction, the same as Claude Code: a synapse decay tick, the team-memory import, clearing the session-scoped (ephemeral) associations, and theSYNAPSE_MEMORY.mdexport (copied into Claude Code’s auto-memory directory only when that exists;NEURALMIND_SYNAPSE_EXPORT=0turns the export off). - Tested against Hermes v0.21.5 (a 0.21.5+5355 main-branch build), in
live
hermes chatsessions and through its plugin loader and hook dispatch, andhermes plugins validatepasses. The manifest’srequires_hermes: ">=0.21.5"makes an older Hermes skip it. It relies onpre_llm_callaccepting{"context": ...}, which that version documents. - Not measured. We haven’t measured what the added context changes in Hermes’s answers.
Options and removal
neuralmind install-hermes-plugin # no path: follow the directory Hermes works in (a re-run keeps an earlier pin)
neuralmind install-hermes-plugin --unpin # clear an earlier pin
neuralmind install-hermes-plugin PATH --no-enable # write the files; enable it yourself
neuralmind install-hermes-plugin PATH --hermes-home DIR # a Hermes home other than the default (the active profile's, else $HERMES_HOME, else ~/.hermes)
neuralmind install-hermes-plugin --uninstall # remove it, and its entries in Hermes's config
(v4.10.0+) --uninstall runs hermes plugins remove neuralmind, which also
drops the plugin’s entries from config.yaml, so installing it again later
turns it back on (v4.9.0 disabled it, so a reinstall stayed off). If hermes isn’t on PATH, the command says so, and you run
hermes plugins enable neuralmind yourself; an uninstall then still removes
the directory and tells you config.yaml still names the plugin. If
plugins/neuralmind is a symlink, the install refuses to write through it,
and --uninstall disables the plugin and removes the link, never its target.
Full flag list:
CLI Reference: install-hermes-plugin.
Walkthrough: Hermes-Agent with code memory in every turn.
Release notes: NeuralMind for Hermes-Agent.
MCP server: tools to call on demand
Hermes ships its own MCP client and discovers configured servers at
startup, so NeuralMind’s tools arrive as first-class tools alongside
terminal and read_file — no bridge process. Register it with or without
the plugin: the plugin adds context on its own each turn, and the MCP tools
let the agent ask for more.
hermes mcp add # interactive
# …or edit ~/.hermes/config.yaml directly
hermes mcp test neuralmind # verify the agent connected
Without the MCP server: install the skill
NeuralMind also ships a portable skill at
skills/neuralmind/SKILL.md.
Hermes can install it straight from GitHub — no registry submission, no
release pipeline, just a repo containing a skills/ directory:
# One skill, without subscribing to the whole repo
hermes skills install dfrostar/neuralmind/skills/neuralmind
# …or add the repo as a tap and get everything under skills/
hermes skills tap add dfrostar/neuralmind
Both forms follow Hermes’s documented
owner/repo/skills/<name> syntax — see
Hermes: Skills.
New taps are assigned community trust, so the first install shows a
third-party warning panel after the security scan.
The skill drives the neuralmind CLI through Hermes’s terminal tool, so
it works with or without the MCP server registered. With both, the MCP
tools take precedence — same retrieval, fewer shell round-trips.
Agent Zero
NeuralMind is listed in Agent Zero’s in-app Plugin Hub — the
a0-plugins index entry
merged on 2026-08-31. Open the Plugins dialog, pick the Browse tab (or the
Install button’s Browse tab) and search for neuralmind.
What the Plugin Hub install actually does
Read this before clicking Install, because it does less than the word suggests:
| It does | It does not |
|---|---|
Clone this repository into usr/plugins/neuralmind/ |
Run pip install neuralmind |
Expose the repo’s skills/ as Agent Zero skills — the framework scans usr/plugins/*/skills |
Register an MCP server |
| Add Readme / License / Update buttons to the Plugins dialog | Give the agent any neuralmind_* tool |
So the listing is a discovery and skill-delivery channel. The MCP wiring below is still yours to do, and until you do it the agent has the skill’s instructions but none of the tools those instructions call.
One side effect worth knowing: the clone carries every SKILL.md in this
repository, so skills/github-issue-audit/ becomes a second Agent Zero skill.
It targets GitHub MCP tools Agent Zero does not ship — hide it from the
Plugins dialog if you do not want it in the catalog.
Wiring the MCP server
-
Install the package where Agent Zero’s server process runs. Agent Zero resolves the
commandbelow on that process’sPATH, so in the standard Docker deployment the install happens inside the container — installing on the host does not satisfy it:pip install neuralmind -
Build an index for each project the agent should know:
neuralmind build /absolute/path/to/repo -
Register the server. Settings → MCP → External MCP Servers → Open, then add the entry to the
mcpServersJSON:{ "mcpServers": { "neuralmind": { "command": "neuralmind-mcp", "args": [] } } }Apply the settings and start a new chat. All 21 tools should then be visible to the agent.
Pass absolute project paths
Agent Zero starts the server detached, so the server’s working directory is
not your project. neuralmind-mcp takes no launch arguments — every tool
resolves its own project_path argument relative to the server process — so
a relative "." points somewhere you did not mean.
The server says so rather than failing quietly: neuralmind_stats returns
built: false with a hint naming the directory the relative path actually
resolved to, and wakeup / query / search raise that hint as an explicit
error instead of indexing the wrong tree. When you see it, retry the same call
with the absolute path — a path inside the container’s filesystem, if Agent
Zero runs in Docker.
OpenClaw
Two ways in, and they are not equivalent.
Skill only, via ClawHub
The portable skill is published on ClawHub as a community-channel package:
openclaw skills install @dfrostar/neuralmind
You can also add it from the UI under Plugins → Skills, and type $ in
the composer to search the skills available to the current agent.
This route drives the neuralmind CLI through OpenClaw’s terminal tool, so it
works with or without the MCP server registered.
On freshness: the ClawHub package is a point-in-time upload, not a mirror
of this repository, so the published copy can lag
skills/neuralmind/SKILL.md
here. Compare the version line in the listing against the file in this repo
before assuming a documented flag exists in the copy you installed.
Maintainers: republish with scripts/publish_clawhub.sh --publish (needs a
CLAWHUB_TOKEN) — the version it uploads is read from SKILL.md’s own
frontmatter, so keep that file’s version: line in sync with a real release
before running it.
MCP server, for the full tool set
pip install neuralmind
neuralmind build /absolute/path/to/repo
openclaw mcp set neuralmind '{"command":"neuralmind-mcp","args":[]}'
openclaw mcp show neuralmind # the definition as saved
openclaw mcp doctor neuralmind --probe # validate, then connect and list tools
OpenClaw also starts the server detached, so the absolute-path rule from the
Agent Zero section applies here unchanged: pass real project paths, not ".".
Custom MCP Clients
For building your own MCP client integration:
Python Client Example
import asyncio
import json
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def query_neuralmind(project_path: str, question: str):
server_params = StdioServerParameters(
command="neuralmind-mcp",
args=[]
)
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Call the query tool
result = await session.call_tool(
"neuralmind_query",
{
"project_path": project_path,
"question": question
}
)
return result
# Usage
result = asyncio.run(query_neuralmind(
"/path/to/project",
"How does authentication work?"
))
print(result)
Tool Schemas
NeuralMind MCP tools follow these schemas:
{
"neuralmind_wakeup": {
"input": {
"project_path": "string (required)"
},
"output": {
"context": "string",
"tokens": "integer",
"layers": "array"
}
},
"neuralmind_query": {
"input": {
"project_path": "string (required)",
"question": "string (required)"
},
"output": {
"context": "string",
"tokens": "integer",
"reduction_ratio": "number",
"layers": "array",
"communities": "array"
}
},
"neuralmind_search": {
"input": {
"project_path": "string (required)",
"query": "string (required)",
"limit": "integer (optional, default 10)"
},
"output": {
"results": "array of search results"
}
},
"neuralmind_build": {
"input": {
"project_path": "string (required)",
"force": "boolean (optional, default false)"
},
"output": {
"nodes_processed": "integer",
"nodes_embedded": "integer",
"communities": "integer",
"time_elapsed": "number"
}
},
"neuralmind_stats": {
"input": {
"project_path": "string (required)"
},
"output": {
"node_count": "integer",
"community_count": "integer",
"last_build": "string"
}
},
"neuralmind_benchmark": {
"input": {
"project_path": "string (required)"
},
"output": {
"results": "array",
"averages": "object"
}
}
}
Optional: NVIDIA NIM for LLM-Enhanced Queries
NeuralMind can use NVIDIA NIM (free, 80+ models) for LLM-based question decomposition in recursive queries:
# Get free API key at https://build.nvidia.com
export NVIDIA_API_KEY="nvapi-..."
# Recursive queries will use NVIDIA for decomposition when available
neuralmind_recursive_query(project_path=".", question="How does auth work?")
Base URL: https://integrate.api.nvidia.com/v1 (OpenAI-compatible)
Recommended models:
- Decomposition:
google/gemma-3-4b-it(fast) - Synthesis:
meta/llama-3.3-70b-instruct(reliable) - Code:
qwen/qwen3-coder-480b-a35b-instruct(specialist)
CI/CD Integration
GitHub Actions
Add NeuralMind to your CI pipeline:
# .github/workflows/neuralmind.yml
name: Update NeuralMind Index
on:
push:
branches: [main]
paths:
- '**.py'
- '**.js'
- '**.ts'
jobs:
update-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install neuralmind
- name: Build NeuralMind index
run: neuralmind build .
- name: Run benchmark
run: neuralmind benchmark . --json > benchmark.json
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: neuralmind-index
path: |
graphify-out/graph.json
graphify-out/neuralmind_db/
benchmark.json
Pre-commit Hook
Validate NeuralMind setup before commits:
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: neuralmind-check
name: Check NeuralMind Index
entry: bash -c 'neuralmind stats . || echo "Warning: NeuralMind index not built"'
language: system
pass_filenames: false
always_run: true
IDE Integration
VS Code
Native Extension (recommended)
Install the NeuralMind VS Code extension for a first-class editor experience — no task configuration needed.
# From the editors/vscode directory in the repo:
cd editors/vscode && npm install && npm run compile
Then load the extension in VS Code via Extensions: Install from VSIX or open editors/vscode/ as a workspace and press F5 to launch a debug session.
What you get:
- Status bar (
$(check) NeuralMind · 2.1k nodes) — green/yellow/red shows index freshness; click to open graph view - Command palette —
NeuralMind: Query,Wakeup,Skeleton,Build Index,Probe,Open Graph View - Graph panel — embedded force-directed graph (the same
neuralmind serveUI) in a WebviewPanel - Auto-build prompt — notifies when the index is stale (configurable threshold)
- Hover cards — opt-in (
neuralmind.enableHover: true) skeleton view on hover
Settings (Ctrl+, → search “NeuralMind”):
| Setting | Default | Description |
|---|---|---|
neuralmind.pythonPath |
python |
Python executable for neuralmind commands |
neuralmind.enableHover |
false |
Skeleton hover cards on symbols |
neuralmind.autoBuildThresholdHours |
24 |
Stale-index prompt threshold |
Task Configuration (fallback, no extension required)
Create .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "NeuralMind: Build Index",
"type": "shell",
"command": "neuralmind build ${workspaceFolder}",
"problemMatcher": [],
"group": "build"
},
{
"label": "NeuralMind: Wake-up Context",
"type": "shell",
"command": "neuralmind wakeup ${workspaceFolder}",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "NeuralMind: Query",
"type": "shell",
"command": "neuralmind query ${workspaceFolder} \"${input:question}\"",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "NeuralMind: Benchmark",
"type": "shell",
"command": "neuralmind benchmark ${workspaceFolder}",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
}
],
"inputs": [
{
"id": "question",
"type": "promptString",
"description": "Enter your question about the codebase"
}
]
}
Keyboard Shortcuts
Add to keybindings.json:
[
{
"key": "ctrl+shift+n w",
"command": "workbench.action.tasks.runTask",
"args": "NeuralMind: Wake-up Context"
},
{
"key": "ctrl+shift+n q",
"command": "workbench.action.tasks.runTask",
"args": "NeuralMind: Query"
}
]
JetBrains IDEs
External Tools Configuration
- Go to Settings → Tools → External Tools
- Add new tool:
Name: NeuralMind Query
Program: neuralmind
Arguments: query $ProjectFileDir$ "$Prompt$"
Working directory: $ProjectFileDir$
- Assign keyboard shortcut in Settings → Keymap
Scripting Integration
Shell Scripts
Complete Update Script
#!/bin/bash
# update_knowledge.sh - Update graphify and NeuralMind
set -e
PROJECT_PATH="${1:-.}"
FORCE_REBUILD="${2:-false}"
echo "Updating knowledge system for: $PROJECT_PATH"
# Build NeuralMind (the code graph is regenerated automatically)
echo "Building NeuralMind index..."
if [ "$FORCE_REBUILD" = "true" ]; then
neuralmind build "$PROJECT_PATH" --force
else
neuralmind build "$PROJECT_PATH"
fi
# Show stats
echo ""
echo "=== Index Statistics ==="
neuralmind stats "$PROJECT_PATH"
echo ""
echo "Done!"
Query Script with Clipboard
#!/bin/bash
# query_and_copy.sh - Query and copy result to clipboard
PROJECT_PATH="$1"
QUESTION="$2"
if [ -z "$PROJECT_PATH" ] || [ -z "$QUESTION" ]; then
echo "Usage: $0 <project_path> <question>"
exit 1
fi
RESULT=$(neuralmind query "$PROJECT_PATH" "$QUESTION")
echo "$RESULT"
# Copy to clipboard
if command -v pbcopy &> /dev/null; then
echo "$RESULT" | pbcopy
echo "\n[Copied to clipboard]"
elif command -v xclip &> /dev/null; then
echo "$RESULT" | xclip -selection clipboard
echo "\n[Copied to clipboard]"
fi
Python Scripts
Batch Processing
#!/usr/bin/env python3
"""Process multiple projects with NeuralMind."""
import sys
from pathlib import Path
from neuralmind import NeuralMind
def process_projects(project_paths: list, questions: list):
"""Process multiple projects with common questions."""
results = []
for project_path in project_paths:
path = Path(project_path)
if not path.exists():
print(f"Skipping {project_path}: not found")
continue
print(f"\nProcessing: {project_path}")
try:
mind = NeuralMind(str(path))
mind.build()
project_results = {
'project': project_path,
'stats': mind.get_stats(),
'queries': []
}
for question in questions:
result = mind.query(question)
project_results['queries'].append({
'question': question,
'tokens': result.budget.total,
'reduction': result.reduction_ratio
})
results.append(project_results)
except Exception as e:
print(f"Error processing {project_path}: {e}")
return results
if __name__ == '__main__':
projects = [
'/path/to/project1',
'/path/to/project2',
]
questions = [
"How does authentication work?",
"What are the main API endpoints?",
]
results = process_projects(projects, questions)
# Print summary
for r in results:
print(f"\n{r['project']}: {r['stats']['node_count']} nodes")
for q in r['queries']:
print(f" - {q['question'][:40]}... ({q['tokens']} tokens, {q['reduction']:.1f}x)")
Watch Mode
#!/usr/bin/env python3
"""Watch for changes and auto-rebuild NeuralMind index."""
import time
import subprocess
from pathlib import Path
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class CodeChangeHandler(FileSystemEventHandler):
def __init__(self, project_path: str):
self.project_path = project_path
self.last_rebuild = 0
self.debounce_seconds = 5
def on_modified(self, event):
if event.is_directory:
return
# Only watch code files
extensions = {'.py', '.js', '.ts', '.java', '.go', '.rs'}
if Path(event.src_path).suffix not in extensions:
return
# Debounce
current_time = time.time()
if current_time - self.last_rebuild < self.debounce_seconds:
return
self.last_rebuild = current_time
print(f"Change detected: {event.src_path}")
self.rebuild()
def rebuild(self):
print("Rebuilding knowledge graph...")
subprocess.run(['graphify', 'update', self.project_path], check=True)
print("Rebuilding NeuralMind index...")
subprocess.run(['neuralmind', 'build', self.project_path], check=True)
print("Done!\n")
if __name__ == '__main__':
import sys
project_path = sys.argv[1] if len(sys.argv) > 1 else '.'
event_handler = CodeChangeHandler(project_path)
observer = Observer()
observer.schedule(event_handler, project_path, recursive=True)
observer.start()
print(f"Watching {project_path} for changes...")
print("Press Ctrl+C to stop\n")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
See Also
- Installation - Setup instructions
- CLI Reference - Command-line interface
- API Reference - Python API documentation
- Architecture - System design details