Skip to content

fix: make RAG vector retrieval reliable - #643

Closed
Summer-Of-Walden wants to merge 1 commit into
codedogQBY:mainfrom
Summer-Of-Walden:codex/rag-vector-retrieval
Closed

fix: make RAG vector retrieval reliable#643
Summer-Of-Walden wants to merge 1 commit into
codedogQBY:mainfrom
Summer-Of-Walden:codex/rag-vector-retrieval

Conversation

@Summer-Of-Walden

Copy link
Copy Markdown

Summary

  • Configure Reader Agent vector queries for the active builtin or remote embedding model.
  • Persist per-book embedding provenance and reject model or endpoint mismatches before semantic search.
  • Preserve retrieval diagnostics when hybrid search falls back to BM25.
  • Decode Tauri SQL's persisted embedding byte-array TEXT form so chunk cosine fallback reads the original vectors.
  • Fix desktop sqlite-vec startup: use the native busy timeout API and preserve an existing table's dimension instead of deleting a different-dimension index on restart.

Root cause

Reader queries previously lacked an embedding service. After wiring it, the code exposed incompatible endpoint contracts and a Tauri SQL embedding decode issue. Separately, VectorDB startup failed on a result-returning PRAGMA and could discard an existing non-384-dimensional sqlite-vec table.

Validation

  • Core TypeScript typecheck passed.
  • Focused core RAG and database tests passed (8 tests across 4 files).
  • Rust VectorDB unit tests passed (2 tests).
  • Desktop development build started successfully and initialized sqlite-vec.
  • Manual Reader Agent regression checks completed.

Scope

CLI/MCP builtin embedding remains intentionally out of scope; CLI/MCP remote queries receive provenance validation.

@Summer-Of-Walden
Summer-Of-Walden marked this pull request as ready for review August 9, 2026 15:38
@Summer-Of-Walden

Copy link
Copy Markdown
Author

Superseded by #646, which keeps the RAG reliability changes and adds the mobile embedding implementation without overlapping #645.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant