Skip to main content
Knowledge Engine · Layer 01

Storage Layer

A single SQLite database per repository. Zero network dependencies. WAL mode for concurrent read/write. FTS5 for full-text symbol search.


Database Location​

.nirnex/index.db

Committed to .gitignore. Never leaves the developer's machine.


Core Tables​

TablePurpose
modulesOne row per source file. Exports, imports, parse method, last SHA
symbolsAll named symbols with kind, file, line, signature
dependenciesDirected graph edges: from_module → to_module
gate_resultsHistorical CI/lint/test results per commit
eco_snapshotsFull ECO JSON stored for every task (Decision Ledger)
trace_eventsEvery pipeline decision event with timestamp and rationale

Design Decisions​

WAL mode — allows reads during writes. The indexer writes atomically while queries continue unblocked.

FTS5 — symbol lookup is full-text, not exact-match. Partial names and fuzzy prefixes work without additional infrastructure.

No ORM — raw SQL via better-sqlite3. Synchronous API. Predictable performance, no async overhead in the hot path.

No vector store in the critical path — embeddings are a Tier 3 fallback. The primary retrieval path is structural, not semantic.