src/core/engine.ts | Pluggable engine interface (BrainEngine) |
src/core/postgres-engine.ts | Postgres + pgvector implementation |
src/core/import-file.ts | importFromFile + importFromContent pipeline |
src/core/sync.ts | Git-based incremental change detection |
src/core/markdown.ts | YAML frontmatter + compiled_truth/timeline parsing |
src/core/embedding.ts | OpenAI embedding with batch, retry, backoff |
src/core/chunkers/recursive.ts | Base chunker (300w, 5-level delimiters) |
src/core/chunkers/semantic.ts | Embedding-based topic boundary detection |
src/core/chunkers/llm.ts | Claude Haiku guided chunking |
src/core/search/hybrid.ts | RRF merge of vector + keyword |
src/core/search/dedup.ts | 4-layer result deduplication |
src/core/search/expansion.ts | Multi-query expansion via Claude Haiku |
src/core/storage.ts | Pluggable storage (S3, Supabase, local) |
src/core/operations.ts | Contract-first operation definitions (31 ops) |
src/schema.sql | Full DDL (10 tables, RLS, tsvector, HNSW) |