A schema pack tells your brain what kinds of pages exist (a person, a company, a meeting), which folders each kind lives in, and which link verbs connect them. nexusbrain uses the active pack to guess a page type from its path, to label links, and to decide which types get extracted and enriched.
This guide shows how to see which pack is active, switch to another pack, make your own, check how well your pages match it, and undo a switch.
nexusbrain init has been run).stats, sync, detect, suggest, review-candidates, review-orphans) need the brain database to be reachable.A pack is a YAML or JSON manifest with api_version: nexusbrain-schema-pack-v1, a name in lowercase slug form, and a version like 1.0.0. It can inherit another pack with extends, for example extends: nexusbrain-base.
Each page type has a name, a primitive (one of entity, media, temporal, annotation, concept), a list of path_prefixes such as people/, optional aliases, and two switches: extractable and expert_routing. The pack also lists link_types (link verbs) and takes_kinds (by default fact, take, bet, hunch).
| Bundled pack | Notes |
|---|---|
nexusbrain-base | The default. Reproduces the built-in behavior from before schema packs existed. |
nexusbrain-recommended | Bundled. |
nexusbrain-creator | Bundled. |
nexusbrain-investor | Bundled. |
nexusbrain-engineer | Bundled. |
nexusbrain-everything | Bundled. |
nexusbrain-base-v2 | Bundled. |
Bundled packs are read-only. Your own packs live in ~/.nexusbrain/schema-packs/<name>/ as pack.yaml, pack.yml or pack.json.
nexusbrain picks the active pack from the first of these that is set: a per-call --schema-pack flag, the NEXUS_BRAIN_SCHEMA_PACK environment variable, a per-source database setting schema_pack.source.<id>, the brain-wide database setting schema_pack, the schema: section of nexusbrain.yml, the schema_pack field in ~/.nexusbrain/config.json, and finally nexusbrain-base.
nexusbrain schema activeYou should seeLines starting Active pack:, Source:, Pack identity:, Page types:, Link verbs: and Takes kinds:. Source tells you which setting chose the pack.
nexusbrain schema listYou should seeA Bundled packs: list, then either Installed packs (~/.nexusbrain/schema-packs/): or a note that you have none.
nexusbrain schema show nexusbrain-investorYou should seeThe page types with their primitive, path prefixes, aliases and [extractable, expert] flags, then the link verbs, takes kinds and enrichable types. Leave out the name to show the active pack. Add --json for machine-readable output.
Always pass the pack name. With no name, validate checks nexusbrain-base.
nexusbrain schema validate nexusbrain-investorYou should seeA line ending in valid manifest, followed by the path and counts of page types, link verbs and takes kinds.
nexusbrain schema use nexusbrain-investorYou should seeActive schema pack set to: nexusbrain-investor and the config file it wrote, which is ~/.nexusbrain/config.json. A pack that fails validation is refused with Refusing to activate.
nexusbrain schema activeYou should seeActive pack: shows the new pack.
sync is a dry run unless you add --apply. It matches pages to the pack by path prefix.
nexusbrain schema syncYou should seeMode: DRY-RUN, one line per type and prefix with would_apply=, sample slugs, and a total.
nexusbrain schema sync --applyYou should seeMode: APPLY and applied= counts per prefix.
schema use writes ~/.nexusbrain/config.json, which is near the bottom of the resolution order. If NEXUS_BRAIN_SCHEMA_PACK or a database setting is set, that still wins. Check with nexusbrain schema active.
The quickest route is to copy an existing pack and edit the copy. init, fork, edit, diff, graph and explain are marked experimental in this version.
nexusbrain schema fork nexusbrain-base my-packYou should seeA line saying the pack was forked to ~/.nexusbrain/schema-packs/my-pack/pack.json.
--primitive and --prefix are required. Add --extractable, --expert or one or more --alias values if you need them.
nexusbrain schema add-type researcher --primitive entity --prefix people/researchers/ --pack my-packYou should seePack: my-pack (json) and a Sha8: line showing the file changed.
nexusbrain schema add-link-type advises --inverse advised_by --pack my-packYou should seeThe same Pack: and Sha8: lines.
Add --with-db to also run the checks that need your brain, such as types with no pages.
nexusbrain schema lint my-packYou should seeOK and lint clean, or a list of ERROR and warn lines with hints.
nexusbrain schema use my-packYou should seeActive schema pack set to: my-pack.
| Authoring command | What it does |
|---|---|
schema init <name> | Scaffold an empty pack that extends nexusbrain-base, at ~/.nexusbrain/schema-packs/<name>/pack.yaml. |
schema fork <src> <new> | Copy a pack to a new editable name. |
schema edit <name> | Print the pack file path so you can open it in an editor. |
schema diff <a> <b> | Show page types only in one pack, only in the other, and the common count. |
schema add-type, remove-type, update-type | Add, remove or change a page type. update-type takes --extractable, --expert and --primitive. |
schema add-alias, remove-alias | Add or remove an alias on a type. |
schema add-prefix, remove-prefix | Add or remove a folder prefix on a type. |
schema add-link-type, remove-link-type | Add or remove a link verb. add-link-type takes --inverse, --page-type and --target-type. |
schema set-extractable <type> <true|false> | Turn extraction on or off for a type. |
schema set-expert-routing <type> <true|false> | Turn expert routing on or off for a type. |
schema scaffold-extractable <type> | Create prompts/extract/<type>.md and fixtures/extract/<type>.jsonl stubs for an extractor. Takes --dims a,b,c and --force. |
Every editing command works on the active pack unless you pass --pack <name>. All the newer verbs accept --json.
Add --source <id> to look at one source only.
nexusbrain schema statsYou should seeTotal pages, Typed with a coverage percentage, Untyped, a By type list, and any Dead prefixes (declared but 0 pages).
nexusbrain schema review-orphansYou should seeOrphan pages (no active-pack type match): with a count and up to 20 slugs. Use --json for the full list.
nexusbrain schema review-candidatesYou should seeCandidate prefixes with page counts and a suggested type, or No candidate types found. Promote one with --apply <prefix>.
--since takes a number with d, w or m, for example 2w. The default is 30d.
nexusbrain schema usage --since 30dYou should seeSchema CLI usage (last 30d):, a total, and a count per verb. Experimental verbs are tagged (experimental).
schema detect groups pages by folder and suggests page types. schema suggest refines that list.schema graph prints each type with its primitive and aliases. schema explain <type> prints one type's settings.schema reload [--pack <name>] clears the pack cache in the current process.Passing --to is the reliable form. Without it, nexusbrain looks for the previous pack in ~/.nexusbrain/schema-pack-history.jsonl, and if it finds none it restores nexusbrain-base.
nexusbrain schema downgrade --to nexusbrain-baseYou should seeActive pack restored to the pack name, the config path, and a note that the command restores config only.
nexusbrain schema activeYou should seeActive pack: shows the restored pack.
Downgrade only changes which pack is active. Pages that were given custom types keep them, and cached and eval rows are not removed. These pages now show up as orphans.
nexusbrain schema review-orphans --jsonYou should seeA JSON list of every page with no type match in the restored pack. Retype or move those pages yourself, or switch back to the pack that defines them.
There is no command that deletes or rewrites custom-typed pages after a downgrade. Plan the cleanup before you switch, and keep a copy of your own pack so you can switch back.
Unknown pack: <name>.Run nexusbrain schema list. Your own pack must be a folder in ~/.nexusbrain/schema-packs/ containing pack.yaml, pack.yml or pack.json.
pack 'nexusbrain-base' is bundled and read-only.Bundled packs cannot be edited. Run nexusbrain schema fork nexusbrain-base <new-name>, then edit the fork with --pack <new-name>.
Invalid manifest at <path> with a Code: line.Fix the field named in the message. Common causes: name not in lowercase slug form, version not in M.m.p form, or a primitive that is not one of entity, media, temporal, annotation, concept.
Re-run nexusbrain schema validate <name>.
--primitive must be one of entity|media|temporal|annotation|concept or --prefix is required.schema add-type needs both flags, for example --primitive entity --prefix people/researchers/.
schema use succeeded but schema active still shows the old pack.A higher setting is overriding the config file. Unset NEXUS_BRAIN_SCHEMA_PACK, or change the database or nexusbrain.yml setting that the Source: line names.