Repository navigation
feat: implement storage layer (PRD-001) - #1
Merged
Merged
Conversation
Implements the complete internal/store/ package per PRD-001: Core files: - store.go — Store interface, SQLiteStore struct, NewStore constructor, config - migrations.go — Schema creation for all 9 tables + FTS5 + triggers + metadata - memory.go — Memory CRUD, batch insert, soft delete, content dedup (SHA-256) - facts.go — Fact CRUD, confidence updates, reinforcement, stale fact detection - embeddings.go — Embedding storage (BLOB), brute-force cosine similarity search - events.go — Append-only event log, FTS5 search with BM25 + snippets, stats Tables created: - memories (with content_hash dedup, soft delete) - memories_fts (FTS5 with porter unicode61 tokenizer, auto-sync triggers) - facts (8 fact types, confidence decay, reinforcement tracking) - embeddings (configurable dimensions, stored in meta table) - recall_log (provenance chains) - memory_events (differential memory, 6 event types) - snapshots (point-in-time restore) - lenses (context-dependent views) - meta (schema version, embedding dimensions, timestamps) Design decisions per Q's review: - Embedding dimensions: configurable, 384 default, stored in meta table - FTS5 tokenizer: porter unicode61 hardcoded (Phase 2: configurable) - Batch size: 500 default, exposed as config option - Vacuum: manual only via Vacuum() method - WAL mode enabled by default - Pure Go SQLite via modernc.org/sqlite (no CGO) Test coverage (33 tests): - All CRUD operations for memories and facts - FTS5 search: keyword, boolean (AND/OR), quoted phrases, snippets - Embedding storage and cosine similarity search - Batch insert performance (100: ~13K/sec, 500: ~22K/sec, 1000: ~16K/sec) - Event logging, stats, stale fact detection, deduplication, vacuum
This was referenced Feb 18, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the complete
internal/store/package per PRD-001.What's Implemented
Core Files
Storeinterface,SQLiteStorestruct,NewStoreconstructor with configurable DB path, batch size, and embedding dimensionsTables
memoriesmemories_ftsfactsembeddingsrecall_logmemory_eventssnapshotslensesmetaDesign Decisions (per Q's review)
porter unicode61hardcoded for MVPVacuum()method, never auto-vacuummodernc.org/sqlite(no CGO)Test Results (33 tests, all passing)
go build,go test,go vetall pass cleanChecklist
go build ./...passesgo test ./...passes (33/33)go vet ./...passesmodernc.org/sqlite