What
Today every mobieusAI question runs the FULLTEXT retrieval query against the source tables. Most communities have a long tail of common questions ("how do I change my password", "how do I make a forum private") that get asked over and over. Caching the top-K snippets per question hash for ~15 minutes cuts the average query path to a single Anthropic call.
Where it lives
- Surface: behind the Q&A drawer; invisible to users
- Backlog id:
B-AI-RAG-3
Implementation notes
- Cache key: SHA-256 of (tenant_slug + scope + normalized question)
- Storage: existing
FileCacheservice with 15-min TTL - Cache stores the retrieved snippets only — the Anthropic call still happens per ask (answers can vary)
- Invalidation: any write to knowledge_pages / forum_threads / forum_posts clears the cache for that tenant
- Estimated win: ~40% reduction in DB read load for common asks
Tracked as B-AI-RAG-3 in docs/BACKLOG.md.
Patrick Bass
@mobieus