brainy/docs/guides/quick-start.md
David Snelling b6e3470b83 docs: add public frontmatter to docs for soulcraft.com/docs pipeline
Add YAML frontmatter (slug, public, category, template, order) to 8
existing docs and 2 new getting-started guides (installation, quick-start).
Include docs/**/*.md in npm package files so the portal sync-docs script
can read them from node_modules after publish.

Update CLAUDE.md with docs pipeline trigger phrases and release checklist.
2026-02-19 17:04:05 -08:00

2.8 KiB

title slug public category template order description next
Quick Start getting-started/quick-start true getting-started guide 2 Build your first knowledge graph in 60 seconds. Add entities, create relationships, and query with Triple Intelligence — vector + graph + metadata in one call.
concepts/triple-intelligence
api/reference

Quick Start

Get Brainy running in under a minute.

1. Install

npm install @soulcraft/brainy

2. Initialize

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

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

That's it. Brainy auto-configures storage, loads the embedding model, and builds the indexes.

3. Add Knowledge

// Text is automatically embedded into 384-dim vectors
const reactId = await brain.add({
  data: 'React is a JavaScript library for building user interfaces',
  type: NounType.Concept,
  metadata: { category: 'frontend', year: 2013 }
})

const nextId = await brain.add({
  data: 'Next.js framework for React with server-side rendering',
  type: NounType.Concept,
  metadata: { category: 'framework', year: 2016 }
})

4. Create Relationships

// Typed graph relationships
await brain.relate({
  from: nextId,
  to: reactId,
  type: VerbType.BuiltOn
})

5. Query with Triple Intelligence

// All three search paradigms in one call
const results = await brain.find({
  query: 'modern frontend frameworks',    // Vector similarity search
  where: { year: { greaterThan: 2015 } }, // Metadata filtering
  connected: { to: reactId, depth: 2 }   // Graph traversal
})

console.log(results.items)
// [{ id: nextId, data: 'Next.js...', score: 0.94, ... }]

What Just Happened

Every entity you add() lives in three indexes simultaneously:

Index What it stores Query with
Vector 384-dim embedding of data find({ query: '...' })
Metadata All metadata fields find({ where: { ... } })
Graph Typed relationships from relate() find({ connected: { ... } })

find() queries all three in parallel and fuses the results.

Natural Language Queries

Brainy understands 220+ natural language patterns:

// These all work without any configuration
await brain.find({ query: 'recent documents about machine learning' })
await brain.find({ query: 'articles created this week' })
await brain.find({ query: 'people who work at Anthropic' })

Next Steps