@brainst0rm/db
v0.13.0
Published
SQLite persistence with WAL mode and auto-migrations
Maintainers
Readme
@brainst0rm/db
SQLite persistence layer using better-sqlite3 with WAL mode. Database at ~/.brainstorm/brainstorm.db.
Key Exports
getDatabase()— Singleton database connection with auto-migrationsPatternRepository— Cross-session learning storage with UPSERT and confidence decay
Tables
sessions, messages, cost_records, agent_profiles, workflow_runs, eval_results, session_patterns
Usage
import { getDatabase, PatternRepository } from "@brainst0rm/db";
const db = getDatabase();
const patterns = new PatternRepository(db);
patterns.record("/path", "tool_success", "file_edit", "jsx files", 0.8);