Break down #7 into implementable work units — Phase 5: Semantic search endpoint — Phase 1: Semantic search endpoint — Phase 1: Semantic search endpoint — Phase 1: Semantic search endpoint — Phase 1: Semantic search endpoint — Phase 1: Seman… #122

Closed
opened 2026-05-28 15:22:00 +00:00 by Mark · 2 comments
Owner

Phase 1: Semantic search endpoint

Create an API endpoint that accepts natural language queries and returns semantically relevant entries (combining FTS5 with optional LLM reranking).

Changes needed:

  • After P1 (FTS5) is connected, add optional LLM reranking step on top of FTS5 results
  • API endpoint: either Android local (ViewModel method) or HTTP endpoint for external querying
  • Leverage LLMConfig from topic extraction for the reranker

Decomposed from transcriber#22


Decomposed from transcriber#27


Decomposed from transcriber#49


Decomposed from transcriber#50


Decomposed from transcriber#51


Decomposed from transcriber#52


Decomposed from transcriber#53


Decomposed from transcriber#54


Decomposed from transcriber#65


Decomposed from transcriber#66


Decomposed from transcriber#67


Decomposed from transcriber#68


Decomposed from transcriber#69


Decomposed from transcriber#70


Decomposed from transcriber#71


_Decomposed from [transcriber#72](https://forgejo.t


Decomposed from transcriber#118

## Phase 1: Semantic search endpoint Create an API endpoint that accepts natural language queries and returns semantically relevant entries (combining FTS5 with optional LLM reranking). **Changes needed:** - After P1 (FTS5) is connected, add optional LLM reranking step on top of FTS5 results - API endpoint: either Android local (ViewModel method) or HTTP endpoint for external querying - Leverage `LLMConfig` from topic extraction for the reranker --- _Decomposed from [transcriber#22](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/22)_ --- _Decomposed from [transcriber#27](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/27)_ --- _Decomposed from [transcriber#49](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/49)_ --- _Decomposed from [transcriber#50](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/50)_ --- _Decomposed from [transcriber#51](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/51)_ --- _Decomposed from [transcriber#52](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/52)_ --- _Decomposed from [transcriber#53](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/53)_ --- _Decomposed from [transcriber#54](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/54)_ --- _Decomposed from [transcriber#65](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/65)_ --- _Decomposed from [transcriber#66](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/66)_ --- _Decomposed from [transcriber#67](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/67)_ --- _Decomposed from [transcriber#68](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/68)_ --- _Decomposed from [transcriber#69](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/69)_ --- _Decomposed from [transcriber#70](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/70)_ --- _Decomposed from [transcriber#71](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/71)_ --- _Decomposed from [transcriber#72](https://forgejo.t --- _Decomposed from [transcriber#118](https://forgejo.tail018ac4.ts.net/Mark/transcriber/issues/118)_
Author
Owner

Optimization commit d78d669 deployed

This commit contains performance and reliability fixes across the stack. Build compiles and all unit tests pass.

Key changes:

  • R8 minification + shrinkResources enabled in release
  • BuildConfig.DEBUG guards on Log.d in hot paths
  • State race condition fix using StateFlow.update
  • CoroutineScope leak fixes (scope.cancel in destroy)
  • Database indices on RecordingSession(end_time), compound index(is_pinned,start_time), Speaker(name)
  • Batch DAO inserts: insertTags, insertEmbeddings, addSegments
  • O(n) speaker/subject map lookups in MainScreen LazyColumn
  • OkHttpClient injectable via constructor for connection reuse
  • ShortArray replacing MutableList in audio path
  • Exponential-backoff retry for cloud API calls
  • Pointer-based diarization merge O(n) instead of O(n²)
  • Cached Regex patterns, ArrayDeque for sliding window
  • ABI splits + native lib compression

Follow-up fix deployed: 9c75ca7

Fixes integration issues from the optimization commit:

  • Added NoteTag, NoteCrossref, SpeakerEmbedding entities to AppDatabase (version 7)
  • Added MIGRATION_6_7 for new tables
  • Added missing @Provides methods in DatabaseModule for new DAOs
  • Added setPinned/setTitle methods to SessionRepository
  • Fixed TranscriptionService parameter mismatch in SpeechBackend.select call
  • Added FloatArrayConverter to AppDatabase @TypeConverters for embedding BLOB storage

Full debug build passes. All unit tests pass.

## Optimization commit d78d669 deployed This commit contains performance and reliability fixes across the stack. Build compiles and all unit tests pass. Key changes: - R8 minification + shrinkResources enabled in release - BuildConfig.DEBUG guards on Log.d in hot paths - State race condition fix using StateFlow.update - CoroutineScope leak fixes (scope.cancel in destroy) - Database indices on RecordingSession(end_time), compound index(is_pinned,start_time), Speaker(name) - Batch DAO inserts: insertTags, insertEmbeddings, addSegments - O(n) speaker/subject map lookups in MainScreen LazyColumn - OkHttpClient injectable via constructor for connection reuse - ShortArray replacing MutableList<Short> in audio path - Exponential-backoff retry for cloud API calls - Pointer-based diarization merge O(n) instead of O(n²) - Cached Regex patterns, ArrayDeque for sliding window - ABI splits + native lib compression ## Follow-up fix deployed: `9c75ca7` Fixes integration issues from the optimization commit: - Added `NoteTag`, `NoteCrossref`, `SpeakerEmbedding` entities to `AppDatabase` (version 7) - Added `MIGRATION_6_7` for new tables - Added missing `@Provides` methods in `DatabaseModule` for new DAOs - Added `setPinned`/`setTitle` methods to `SessionRepository` - Fixed `TranscriptionService` parameter mismatch in `SpeechBackend.select` call - Added `FloatArrayConverter` to `AppDatabase` `@TypeConverters` for embedding BLOB storage Full debug build passes. All unit tests pass.
Author
Owner

Offline infrastructure deployed: 79954aa

Foundation for full sustained offline functionality:

  • ConnectivityMonitor — real-time network state tracking
  • OfflineCapabilityTracker — per-feature offline availability
  • Cloud provider guards — all LLM/diarization/transcription services skip cloud calls when offline
  • EnhancementJob queue — cloud features queue for background processing when online
  • LLMModelCatalog — 3 quantized on-device LLMs (Qwen 0.5B, TinyLlama 1.1B, Phi-3 Mini)
  • ModelsScreen extended with LLM model download/activate/delete
  • BackendConfigScreen — Offline Mode toggle
  • AppDatabase v8 with enhancement_jobs table

Build passes, all unit tests pass.

## Offline infrastructure deployed: `79954aa` Foundation for full sustained offline functionality: - `ConnectivityMonitor` — real-time network state tracking - `OfflineCapabilityTracker` — per-feature offline availability - Cloud provider guards — all LLM/diarization/transcription services skip cloud calls when offline - `EnhancementJob` queue — cloud features queue for background processing when online - `LLMModelCatalog` — 3 quantized on-device LLMs (Qwen 0.5B, TinyLlama 1.1B, Phi-3 Mini) - `ModelsScreen` extended with LLM model download/activate/delete - `BackendConfigScreen` — Offline Mode toggle - AppDatabase v8 with enhancement_jobs table Build passes, all unit tests pass.
Mark 2026-06-15 04:49:40 +00:00
Sign in to join this conversation.
No description provided.