brainy/docs
David Snelling 970e08c466 feat(8.0): reserved-field contract — one canonical location, typed prevention, unified read/write
Brainy-owned field names (noun/verb, subtype, createdAt, updatedAt,
confidence, weight, service, data, createdBy, _rev) now have exactly one
home — top level — enforced by three layers driven from a single source of
truth, src/types/reservedFields.ts (RESERVED_ENTITY_FIELDS /
RESERVED_RELATION_FIELDS, exported):

1. Compile time — AddParams/UpdateParams/RelateParams/UpdateRelationParams
   metadata (and the transact() ops that extend them) reject a literal
   reserved key as a TypeScript error while keeping generic T ergonomics
   (typed bags, untyped brains, index-signature shapes, and a documented
   exemption for T-declared reserved keys). Pinned by @ts-expect-error
   type tests run under vitest typecheck mode on every unit run.

2. Write time — the 7.x update() remap is ported to 8.0 and extended to
   every write path: add/update/relate/updateRelation, their transact()
   mirrors, and db.with() overlays. User-settable fields lift to their
   dedicated param (top-level wins when both are supplied — closes the 7.x
   trap where update({metadata:{confidence}}) silently no-oped), and
   system-managed fields drop with a one-shot warning naming the right
   path. A remapped subtype satisfies subtype-pairing enforcement exactly
   like a top-level one.

3. Read time — every storage combine goes through one canonical hydration
   helper (hydrateNounWithMetadata / hydrateVerbWithMetadata over
   splitNoun/VerbMetadataRecord), so reserved fields surface ONLY top-level
   and entity/relation.metadata carry ONLY custom fields on live reads,
   batch reads, paginated listings, getRelations by source/target, streamed
   verbs, and historical asOf() materialization alike.

Read-path echoes found and fixed (previously the full stored record —
including the verb type key — leaked inside metadata): noun pagination,
verb pagination, getVerbsBySource/ByTarget (adjacency + shard fallback),
getVerbsBySourceBatch (which also dropped subtype/data), and the
filesystem verb stream. getRelations() results now surface
confidence/updatedAt top-level via verbsToRelations, updateRelation() no
longer erases service/createdBy, relate() persists its top-level
confidence/service params, and the dead convertHNSWVerbToGraphVerb echo
path is deleted. Import paths (CLI extract, deduplicator, coordinators,
neural import) write confidence through the dedicated param instead of the
bag. UpdateRelationParams is now exported from the package root.

Documented for consumers in docs/concepts/consistency-model.md ("Reserved
fields") and RELEASES.md. Regression tests ported from the 7.x fix and
extended to the full 8.0 contract (17 runtime tests + 41 type-level
assertions); full unit suite 1427/1427, db-mvcc integration 24/24.
2026-06-11 13:13:09 -07:00
..
api docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
architecture feat(8.0): brain.fillSubtypes migration helper + pre-RC1 gap closure 2026-06-11 10:53:55 -07:00
augmentations docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
concepts feat(8.0): reserved-field contract — one canonical location, typed prevention, unified read/write 2026-06-11 13:13:09 -07:00
features docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
guides refactor(8.0): delete DataAPI — superseded by Db persist/restore + import API + stats 2026-06-11 09:05:12 -07:00
operations chore(8.0): step-7 follow-through — collapse remaining cloud branches + docs sweep (scaffold step 13) 2026-06-09 15:05:02 -07:00
vfs feat(8.0): brain.fillSubtypes migration helper + pre-RC1 gap closure 2026-06-11 10:53:55 -07:00
ADR-001-generational-mvcc.md feat(8.0): full query surface at historical generations via ephemeral index materialization 2026-06-11 08:12:11 -07:00
BATCHING.md docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
CREATING-AUGMENTATIONS.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
DATA_MODEL.md feat: verb subtype + updateRelation + requireSubtype enforcement 2026-06-05 11:15:52 -07:00
DEVELOPER_LEARNING_PATH.md docs(8.0): Phase F — deep clean across 21 docs 2026-06-09 16:13:35 -07:00
eli5.md feat(8.0): brain.fillSubtypes migration helper + pre-RC1 gap closure 2026-06-11 10:53:55 -07:00
EXTENDING_STORAGE.md fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00
FIND_SYSTEM.md docs: add public frontmatter to docs for soulcraft.com/docs pipeline 2026-02-19 17:04:05 -08:00
MIGRATION-V3-TO-V4.md chore(release): 4.0.0 2025-10-17 14:48:34 -07:00
neural-extraction.md feat: queryAggregate() + HAVING, plus aggregate backfill, traversal depth/via, extraction typing (BR-ADV-FEATURES-BUN) 2026-05-26 13:55:43 -07:00
PERFORMANCE.md docs(8.0): Phase F — deep clean across 21 docs 2026-06-09 16:13:35 -07:00
PLUGINS.md docs(8.0): Phase F — deep clean across 21 docs 2026-06-09 16:13:35 -07:00
PRODUCTION_SERVICE_ARCHITECTURE.md feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
QUERY_OPERATORS.md feat: verb subtype + updateRelation + requireSubtype enforcement 2026-06-05 11:15:52 -07:00
README.md docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
RELEASE-GUIDE.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
SCALING.md docs(8.0): Phase F — deep clean across 21 docs 2026-06-09 16:13:35 -07:00
STAGE3-CANONICAL-TAXONOMY.md fix: exclude __words__ keyword index from corruption detection and getStats() 2026-01-27 15:38:21 -08:00
transactions.md docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs 2026-06-11 08:37:26 -07:00
troubleshooting.md feat: migrate embeddings to Candle WASM + remove semantic type inference 2026-01-06 12:52:34 -08:00
universal-display-augmentation.md fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00

Brainy Documentation

The multi-dimensional AI database with Triple Intelligence — vector search, graph traversal, and metadata filtering in one unified API.

Quick Start

import { Brainy, NounType, VerbType } from '@soulcraft/brainy'

const brain = new Brainy()
await brain.init()

// Add entities — data is embedded for semantic search, metadata is indexed for filtering
const id = await brain.add({
  data: 'Revolutionary AI Breakthrough',
  type: NounType.Document,
  metadata: { category: 'technology', rating: 4.8 }
})

// Search with Triple Intelligence
const results = await brain.find({
  query: 'artificial intelligence',              // Semantic search (on data)
  where: { rating: { greaterThan: 4.0 } },       // Metadata filter
  connected: { from: authorId, depth: 2 }         // Graph traversal
})

Core Documentation

Document Description
API Reference Complete API documentation — start here
Data Model Entity structure, data vs metadata, storage fields
Query Operators All BFO operators with examples and indexed/in-memory matrix
Find System Natural language find() and hybrid search details
Consistency Model The Db API guarantees — snapshot isolation, atomic transactions, time travel

Architecture

Document Description
Architecture Overview High-level system design
Triple Intelligence Vector + Graph + Metadata unified query
Noun-Verb Taxonomy 42 nouns + 127 verbs type system
Stage 3 Canonical Taxonomy Complete type reference
Storage Architecture Storage adapters and optimization
Index Architecture Vector, Graph, and Metadata indexing
Zero Configuration Auto-adapts to any environment

Virtual Filesystem (VFS)

Document Description
VFS Quick Start Get started in 30 seconds
VFS Core Core concepts and architecture
VFS API Guide Complete VFS API reference
Common Patterns VFS usage patterns

See vfs/ for the complete VFS documentation set.


Guides

Document Description
Import Anything CSV, Excel, PDF, URL imports
Snapshots & Time Travel Backups, restore, what-if analysis, audit trails
Natural Language Query in plain English
Neural API AI-powered features
Enterprise for Everyone No limits, no tiers
Framework Integration React, Vue, Angular, Svelte

Storage & Deployment

Document Description
Storage Architecture Filesystem and memory adapters, on-disk artifact layout, operator-layer backup
Extending Storage Create custom storage adapters
Capacity Planning Scale to millions of entities

Plugins & Augmentations

Document Description
Plugins Plugin system overview
Creating Augmentations Build custom plugins
Augmentations Reference Full augmentation API
Augmentations Developer Guide Plugin development guide

Performance & Scaling

Document Description
Performance Optimization techniques
Scaling Scale to billions of entities
Batching Batch operations guide

Migration & Reference

Document Description
v3 to v4 Migration Upgrade guide
Release Guide How to release new versions
Production Architecture Ops reference

Internal

Document Description
Audit Report Feature audit
Honest Status Actual implementation status

License

Brainy is MIT licensed. See LICENSE for details.