What problem does it solve?
Provides clear, production-oriented patterns and safety rules for building and operating agent memory layers backed by SQLite, preventing data loss, inconsistent indexes, and unsafe embedding usage.
Core Features & Use Cases
- SQLite source-of-truth with WAL mode and scoped lifecycle management to ensure durable, consistent persistence.
- Four memory types (semantic, episodic, procedural, working) with guidance on storage, eviction, and capacity limits for each usage pattern.
- Two-tier search strategy: FTS5-based BM25 ranking for Tier 1 and optional sqlite-vec KNN with embeddings from LLMService.embed for Tier 2.
- Working memory pattern implemented as an in-process Ref with controlled capacity and FIFO/LRU eviction.
- Zettelkasten link graph stored in SQLite for inter-note relations and cross-references, plus guidelines for snapshot, flush, and consolidation operations.
Quick Start
Initialize a memory layer using bun:sqlite with WAL mode, scaffold Layer.scoped and Effect.acquireRelease for DB lifecycle, bootstrap the agent to load memory.md, and run a flush to persist and regenerate the projection file.