Expand description
nexcore-db — Persistent SQLite storage for NexCore Brain working memory.
Replaces the file-based JSON storage with a single SQLite database, providing ACID transactions, WAL mode for concurrent reads, and structured queries across sessions, artifacts, implicit knowledge, and code tracking data.
§Architecture
nexcore-brain (business logic)
↓
nexcore-db (persistence)
↓
rusqlite + SQLite (bundled)§Usage
use nexcore_db::pool::DbPool;
use nexcore_db::sessions;
let pool = DbPool::open_default().expect("open db");
pool.with_conn(|conn| {
let all = sessions::list_all(conn)?;
println!("Found {} sessions", all.len());
Ok(())
}).expect("query");Modules§
- artifacts
- Artifact and artifact version CRUD operations.
- autopsy
- Directive Autopsy Engine record CRUD.
- autopsy_
engine - Directive Autopsy Engine — structured post-mortem analysis of sessions.
- decisions
- Decision audit CRUD operations.
- error
- Error types for the database layer.
- implicit
- Implicit knowledge CRUD: preferences, patterns, corrections, beliefs, trust accumulators, and belief implications.
- knowledge
- Accumulated knowledge CRUD: tasks history, handoffs, and antibodies.
- migrate
- One-shot JSON-to-SQLite migration.
- pdp_
telemetry - PDP (Point-Driven Prompting) evaluation telemetry writer.
- pool
- Connection management for the Brain SQLite database.
- schema
- Database schema definition and migration.
- sessions
- Session CRUD operations.
- telemetry
- Tool usage and token efficiency telemetry CRUD.
- tracker
- Code tracker CRUD: content-addressable file snapshots.