Keyless semantic search, direction-aware graphs, dynamic schema (phase 1), strict curation
Local (keyless) vector search
Semantic search now runs with no hosted API key at all, via local embeddings (nomic-embed-text on Ollama, 768d) selected with BRAIN_EMBED_PROVIDER=ollama — auto-selected when an Ollama base URL is configured and no OpenAI key is present. The existing OpenAI text-embedding-3-small path is unchanged; each provider stores vectors in its own table, so switching providers never causes a dimension clash. brain_search, brain_context_pack, and brain_recall_memory all join the active provider’s table. Verified by npm run test:local-embeddings.
Direction-aware relationship extraction
The extraction prompt now states that relations are directed (subject → predicate → object), defines subject vs. object, and includes worked directional examples — including the passive-voice trap that flips small models. On the gold fixture this lifts llama3.2:3b direction accuracy from ~79% to ~93%. A regression check, npm run test:direction, measures a model’s directed accuracy against the fixture and fails below the configured threshold.
Dynamic schema — phase 1 (propose & surface)
- The extraction worker records entity kinds and relationship predicates it observes that aren’t in the catalogs as pending schema proposals — provenance-tagged and deduped per workspace.
- brain_stats gains a schema section, and the summary surfaces “Brain proposed N new types from your data (pending review).”
- Promotion stays manual — nothing auto-applies. Entities with a not-yet-cataloged kind stay in the review queue, so a novel “product” can never be mislabeled as an organization or fuzzy-merged into one.
- A seeded relationship-type catalog ships the eight canonical predicates the extraction prompt teaches, so the known-predicate filter has a real baseline.
Verified by npm run test:dynamic-schema.
Strict curation mode
BRAIN_REQUIRE_HUMAN_REVIEW=1 disables all auto-promotion: every extracted entity and relation waits in the review queue, and nothing reaches the canonical graph without a human decision. The LLM writes proposals; the human writes the graph — as a switch. Covered by a differential end-to-end check, npm run test:strict-mode (no LLM required).
Run the checks yourself
Every headline claim in this release maps to a named check in the repo:
npm run test:local-embeddings— keyless semantic search end-to-endnpm run test:direction— directed-relation accuracy against the gold fixturenpm run test:dynamic-schema— schema proposal capture and review-queue gatingnpm run test:strict-mode— differential check that strict mode promotes nothing
Full details in the repository changelog. Tool contracts remain stable — no breaking changes to any brain_* tool in this release.