Install the CLI, run subnet for the interactive menu, or
subnet setup on first run. Day-to-day refresh is
subnet update.
https://ollama.com, zero-key default fallback) and/or an OPENROUTER_API_KEY / CURSOR_API_KEY for the faster tiersgit clone https://github.com/tienan92it/SubstrateNet
cd SubstrateNet
npm install
npm run build
npm link # exposes `subnet` on $PATH
Verify:
subnet --version # 0.2.0
subnet --help # six essentials; run `subnet` for the menu
The default routing is flash-first: set
OPENROUTER_API_KEY and bulk agents use a cheap flash model, while
heavy reasoning routes to a Cursor SDK backend (CURSOR_API_KEY).
Both are optional — without keys, every agent falls back to local Ollama, so
a zero-key run works end to end. Either way an LLM is required: without one,
only the deterministic syntax pass runs and the agent layers stay empty (no
regex pretends to understand meaning).
For the fully-local path, pull the fallback models:
ollama pull qwen2.5:14b # reasoning + extraction (~9 GB Q4)
ollama pull nomic-embed-text # embeddings — dedupe, clustering (~0.3 GB)
Fits comfortably on a 24 GB unified-memory Mac. For smaller machines or the larger local lineup, see configuration → hardware budgets.
Keep them warm between agent calls:
launchctl setenv OLLAMA_KEEP_ALIVE 30m
launchctl setenv OLLAMA_MAX_LOADED_MODELS 2
# restart Ollama after these
One command discovers local workspaces (Cursor, Claude Code, Codex, VS Code/Cursor workspace storage), lets you select projects, estimates LLM cost or local runtime, then runs the full pipeline through dashboard build.
npm run build:dashboard # once, if not using build:all
subnet setup
Non-interactive:
subnet setup --discover-only
subnet setup --plan-only --projects /path/a,/path/b
subnet setup --profile standard --projects /path/a --yes --open
--plan-only prints a per-phase table (triage, extract, cluster,
analyze, enrich-fused, …) with token and cost estimates. Flags:
--profile lean|standard|deep, --prose,
--verify, --reprocess, --skip-dashboard,
--json. See CLI → setup and
pipeline refactor RFC.
After setup, one command keeps every registered project fresh. Or run
subnet with no arguments for the interactive menu.
subnet update # standard: tier-1 analyze + fused enrich
subnet update --fast # lean: transcript-only (seconds)
subnet update --deep # all files + legacy enrich (incremental)
subnet update --full # deep + reprocess all windows (model change)
subnet update --global --open # also rebuild + open the global dashboard
subnet doctor # health report
subnet doctor --fix # repair summaries + re-link + rebuild dashboards
Keep it fresh automatically with subnet watch, a Cursor hook, or
a nightly cron/launchd job — see automation →.
subnet status .
# Substrate Net status
# Project: /your/project
# L0 code:
# files: 142
# nodes: 2,041
# edges: 3,177
# L1 conversations:
# sessions: 24
# turns: 487
# L1.5 triage:
# windows: 93
# triaged: 93 (kept=71, dropped=22)
# L2 facts: 128
# L2.5 domain:
# entities: 8
# relationships: 11
# knowledge gaps: 2
# By scope: technical 34 industry 9 untagged 85
# By grounding: stated 96 structural 24 corroborated 8
# L3 concepts: 31
# Agent runs: 254
Inspect what got dropped vs kept and why:
subnet triage audit --dropped
See what you know across projects, then open the dashboards (build the viewer bundle once with npm run build:dashboard):
subnet global wisdom # leveled competencies, insights, gaps (text)
subnet global dashboard --open # the DIKW Profile (Wisdom) + Map
subnet dashboard --open # per-project knowledge graph (hidden command)
See the dashboard guide for the Wisdom layer, the views, and the shareable graph.json.
The per-stage commands below still work but are hidden from
subnet --help and deprecated in favor of update /
global (removal scheduled for 0.3.0). Prefer
subnet setup or subnet update unless you are
debugging a single stage.
subnet init # create .substrate-net/ + register in global.db
subnet sync # L0 code graph
subnet ingest # L1 → L3 + L2.5 agent pipeline
subnet global link # L4 cross-project links + L5 skill graph
subnet global profile # industries + top skills
subnet global skills --cross # skills in more than one project
ingest is incremental — only new windows are processed. Use
subnet update --full (or subnet ingest --reprocess)
after a model swap or interrupted run.
Generate canvases (open in Cursor's canvas pane):
subnet canvas triage-audit
subnet canvas project-map
subnet canvas decision-timeline
subnet canvas business-logic
Or query the graph directly:
sqlite3 .substrate-net/knowledge.db \
"SELECT kind, title FROM k_nodes WHERE kind='decision' ORDER BY confidence DESC LIMIT 10;"
| Symptom | Cause & fix |
|---|---|
L0 code: 0 files after sync |
Project has no files in supported languages. Check supported languages. |
L1 conversations: 0 sessions |
No agent has written transcripts for this project path yet. Run the agent against the project once, then subnet update. |
L3 concepts: 0 while facts > 0 |
Embedding model not reachable. Check ollama list and that ~/.substrate-net/config.json points at it. |
triage labels everything unknown with confidence 0.1 |
Triage Agent call failed — Ollama down or wrong model name. Check ollama serve and the agent_runs table for the error column. |
| enrichment / skills / industry all zero on a frontier backend | Agent calls are failing. Query SELECT agent_name, ok, error FROM agent_runs WHERE ok=0. A requires apiKey error means a raw key was pasted into apiKeyEnv (use apiKey, or set the env var); a 400 means a wrong model slug. |
enrich reports zeros on a re-run |
Expected — the report counts rows added this run. The data already exists; check subnet status for totals. Use subnet update --full to force a full re-pass. |
Dependencies: 0 in a monorepo |
Manifests live in subdirectories — the parser walks nested folders (skipping node_modules / build / …). If still zero, the manifest format may be unsupported; open an issue. |
subnet: command not found |
You skipped npm link. Either run it now, or invoke node dist/cli/index.js directly. |
Next: architecture → or cli reference →.