Repository navigation
fix(server): subquery bm25() before JOIN to fix hybrid search - #2
Merged
Merged
Conversation
bm25() in SQLite FTS5 cannot be used in a JOIN context directly on the virtual table. Pull it into a derived table first, then join entries against that result to get doc_id grouping.
mtib
added a commit
that referenced
this pull request
May 21, 2026
Replace Parakeet TDT 0.6B v3 (3 GB peak, not realtime on M1 Air) with three CTC-headed offline models behind the existing picker: - Parakeet TDT-CTC 110M (EN, ~99 MB) — default, best English quality - FastConformer CTC multilingual (EN/DE/ES/FR, ~98 MB) — adds German - Moonshine Tiny (EN, ~45 MB) — kept as lightest fallback Both new models settle at ~630 MB RSS with mic + system active; ~4 s load time under CoreML. Settings migrates the stored "parakeet" value. Pipeline: when system audio is voiced, the mic stream is now fully gated — no resample, no VAD, no decode. Mic VAD is flushed on gate entry so any open segment closes cleanly. The single shared recognizer (NSLock) is unchanged. Also tightened VAD buffer compaction (after every drain). Quit UX: applicationShouldTerminate now returns .terminateLater and drains on a detached task, replying once flush completes. MenuBarController gets beginQuitTransition() to dim the status item and freeze the label. Measured quit on a running pipeline: 0.74 s (was up to 5 s of frozen UI). Cleanup: delete the orphaned RNNoise wrapper, DenoisingAudioSource, and vendored CRNNoise target — Pipeline never wired them in. CLAUDE.md: refreshed architecture diagram and model table, documented NSString lifetime across C calls (bite #3) and why the 0.6B was dropped (bite #2).
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
bm25()in SQLite FTS5 cannot be called in aJOINcontext — it must be evaluated directly against the FTS virtual tablebm25()first, then joinsentriesagainst the result to group bydoc_idsqlite3.OperationalError: unable to use function bm25 in the requested contextonGET /search/hybridTest plan
GET /search/hybrid?q=<term>returns 200 with results instead of 500🤖 Generated with Claude Code