discourse-ai/lib
Rafael dos Santos Silva 791fad1e6a
FEATURE: Index embeddings using bit vectors (#824)
On very large sites, the rare cache misses for Related Topics can take around 200ms, which affects our p99 metric on the topic page. In order to mitigate this impact, we now have several tools at our disposal.

First, one is to migrate the index embedding type from halfvec to bit and change the related topic query to leverage the new bit index by changing the search algorithm from inner product to Hamming distance. This will reduce our index sizes by 90%, severely reducing the impact of embeddings on our storage. By making the related query a bit smarter, we can have zero impact on recall by using the index to over-capture N*2 results, then re-ordering those N*2 using the full halfvec vectors and taking the top N. The expected impact is to go from 200ms to <20ms for cache misses and from a 2.5GB index to a 250MB index on a large site.

Another tool is migrating our index type from IVFFLAT to HNSW, which can increase the cache misses performance even further, eventually putting us in the under 5ms territory. 

Co-authored-by: Roman Rizzi <roman@discourse.org>
2024-10-14 13:26:03 -03:00
..
ai_bot FEATURE: allow persona to only force tool calls on limited replies (#827) 2024-10-11 07:23:42 +11:00
ai_helper FIX: Bail earlier when a chat thread has no messages (#789) 2024-08-30 17:17:14 -03:00
automation FEATURE: allow llm triage to automatically hide posts (#820) 2024-10-04 16:11:30 +10:00
completions FEATURE: Tools for models from Ollama provider (#819) 2024-10-11 07:25:53 +11:00
configuration FIX: Correctly display errors when parent module needs to be disabled first (#788) 2024-08-30 17:16:11 -03:00
database DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
embeddings FEATURE: Index embeddings using bit vectors (#824) 2024-10-14 13:26:03 -03:00
inference DEV: Log error responses on Gemini / Cloudflare embeddings requests (#736) 2024-08-01 17:25:24 -03:00
nsfw DEV: Fix various typos (#434) 2024-01-19 12:51:26 +01:00
sentiment UX: Use stacked line chart for post sentiment (#737) 2024-08-02 14:23:29 -07:00
summarization FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00
tasks/modules FEATURE: Index embeddings using bit vectors (#824) 2024-10-14 13:26:03 -03:00
tokenizer FEATURE: GPT4o Tokenizer (#721) 2024-07-22 15:26:14 -03:00
toxicity FIX: Truncate content for sentiment/toxicity classification (#431) 2024-01-17 15:17:58 -03:00
utils FEATURE: Add basic connection check to DNS SRV resources (#563) 2024-04-12 10:39:19 -03:00
automation.rb FEATURE: allow llm triage to automatically hide posts (#820) 2024-10-04 16:11:30 +10:00
chat_message_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
engine.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
guardian_extensions.rb FEATURE: Allow specific groups access to summary feature on PMs (#760) 2024-08-21 07:58:24 +10:00
multisite_hash.rb FIX: properly cache user locale (#593) 2024-04-26 09:28:35 -03:00
post_classificator.rb DEV: port directory structure to Zeitwerk (#319) 2023-11-29 15:17:46 +11:00
summarization.rb FEATURE: move summary to use llm_model (#699) 2024-07-04 10:48:18 +10:00