What
Replace the FULLTEXT + LIKE retrieval that powers the mobieusAI Q&A flagship (#40) with cosine-similarity over per-tenant embeddings. Today retrieval is keyword-driven, so "how do I add a mod" surfaces threads about "moderator" but not threads phrased "promote a member to staff." Semantic search closes that gap.
Where it lives
- Surface: Q&A drawer (every page when logged in)
- Backlog id:
B-AI-RAG-1
Implementation notes
- BYOK embeddings provider (Voyage AI or equivalent) — same per-tenant key model as Anthropic
- New
ai_assistant_embeddingstable per tenant: (source_table, source_id, embedding BLOB, dim, updated_at) - Backfill worker: nightly recompute deltas, plus on-write hook for new content
- Top-K retrieval at query time: cosine vs. the question embedding
- Falls back to the existing FULLTEXT path when no embeddings are present
Tracked as B-AI-RAG-1 in docs/BACKLOG.md.
Patrick Bass
@mobieus