How star-ga/mind-nerve works
mind-nerve is an intent-based preselector between a prompt and an agent runtime: it encodes the query, ranks catalog entries, and returns a fixed top-K list. Its runtime can be called directly, through a socket daemon, or via MCP and agent hooks; the installer wires supported clients into that path. A separate catalog/model lifecycle prepares routing data and weights. The README documents these capabilities; unsampled modules are shown only where their role is supported, and uncertain internal wiring is omitted.
Main entry points: daemon_client.py Daemon client · inference.py Encode and rank · daemon.py Socket daemon · preselect_hook.py Preselect hook
Components 22
Routing runtime
- Python API
python/mind_nerve/__init__.py - Route CLI
python/mind_nerve/cli.py - Encode and rank
python/mind_nerve/inference.py - Native encoder
python/mind_nerve/_native.py - Q16 runtime
mind/runtime/nerve_rt_shims.c - Socket daemon
python/mind_nerve/daemon.py - Daemon client
python/mind_nerve/daemon_client.py
Catalog and model
- Runtime weights and tables
python/mind_nerve/inference.py - Corpus preparation
catalog-builder/build_corpus.py - Catalog index
catalog-builder/build_index.py - Catalog encoding
catalog-builder/format/cat_v2.py - Phase-one training
catalog-builder/train_phase1.py - Encoder quantization
tools/quantize_encoder_to_q16.py
Agent interfaces
- MCP server
python/mind_nerve/mcp_server.py - Preselect hook
python/mind_nerve/preselect_hook.py - Claude projector
integrations/claude-code/projector.ts - Runtime subprocess
integrations/claude-code/subprocess.ts
Client setup
- Client installer
integrations/installer/src/index.ts - Install wiring
integrations/installer/src/install.ts
Other components
- Prompt user
- Hugging Face
- Agent runtime
Connections 23
- Prompt user → Python API: submits prompt
- Python API → Encode and rank: routes directly
- Prompt user → Route CLI: submits prompt
- Route CLI → Encode and rank: routes directly
- Encode and rank → Runtime weights and tables: loads weights and catalog
- Encode and rank → Native encoder: encodes query
- Native encoder → Q16 runtime: calls native runtime
- Hugging Face → Runtime weights and tables: provides weights
- Socket daemon → Encode and rank: loads and routes
- Prompt user → Daemon client: submits prompt
- Daemon client → Socket daemon: sends socket request
- Socket daemon → Daemon client: returns ranked routes
- MCP server → Daemon client: routes via daemon
- Preselect hook → Daemon client: routes via daemon
- Agent runtime → Claude projector: starts prompt hook
- Claude projector → Runtime subprocess: invokes runtime
- Runtime subprocess → Daemon client: requests routes
- Preselect hook → Agent runtime: returns selected routes
- Corpus preparation → Catalog index: prepares source data
- Catalog index → Catalog encoding: encodes catalog
- Phase-one training → Encoder quantization: produces encoder weights
- Encoder quantization → Runtime weights and tables: emits Q16 weights
- Client installer → Install wiring: dispatches install