Phase 2: embedded store + context injection - #8
Merged
Conversation
- Add internal/store package: SQLite (modernc.org/sqlite), schema migrations, CRUD operations for events/emails/todos/contacts, cosine similarity vector search, and Embedder interface. - Add SearchSummaries() and SaveInteraction() for engine.ContextSearcher. - Add Embed(), GenerateWithContext(), ChatWithContext() to engine. - Add ContextSearcher interface to engine (no circular dependency). - Update internal/config: add EmbeddingModel, DBPath fields. - Wire store context injection into ask/chat commands. - Implement learn command (re-index events missing embeddings). - Unit tests: 12 tests covering all CRUD, vector search, interface methods. Agent-Logs-Url: https://github.com/Kritarth-Dandapat/super-ollama/sessions/a33144a1-c45f-4fe3-84de-acf2a6756c28 Co-authored-by: Kritarth-Dandapat <141005022+Kritarth-Dandapat@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Kritarth-Dandapat/super-ollama/sessions/a33144a1-c45f-4fe3-84de-acf2a6756c28 Co-authored-by: Kritarth-Dandapat <141005022+Kritarth-Dandapat@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add embedded store and context injection for Phase 2
Phase 2: embedded store + context injection
Apr 11, 2026
dkritarth
approved these changes
Apr 11, 2026
dkritarth
left a comment
Member
There was a problem hiding this comment.
Verified locally: go test ./... -count=1 passes on macOS (PR branch). Internal/store + engine + server packages OK.
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.
Implements Module 2 / Phase 2 from the super-ollama plan: a local SQLite-backed data store with semantic vector search, wired into every inference path for automatic context injection.
internal/store(new)modernc.org/sqlite(pure Go, no CGO) — auto-migrates a 4-table schema (events,emails,todos,contacts) onOpen()store.Embedderdecouples embedding generation from the store; wired post-open viaSetEmbedder()Search()/SearchSummaries()run in-process cosine similarity ranking (no external vector DB)SaveInteraction()— persists every prompt/response pair as asource='interaction'event for future retrievalInsertEvent,InsertEmail,UpsertTodo,UpsertContact,UpdateEventEmbedding,EventsWithoutEmbeddinginternal/engine— context-aware inferenceContextSearcherinterface keepsengineindependent ofstore(no import cycle).internal/config— new fieldsembedding_model(default:nomic-embed-text) anddb_path(default:~/.super-ollama/data.db) withResolvedDBPath()expanding~.CLI changes
learncommand (was stub) — iteratesEventsWithoutEmbedding, callsEmbed(), persists results; respectsSIGINTask/chat— open store on startup, inject semantic context per turn; degrade gracefully if store is unavailableconfig show— now printsembedding_modelanddb_pathTests
12 unit tests in
internal/storeusing in-memory SQLite (:memory:), covering schema migration, all CRUD paths, cosine similarity correctness,SearchSummaries, andSaveInteraction.