Go to file
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
.github/workflows Initial commit 2023-02-17 11:33:47 -03:00
admin/assets/javascripts/discourse UX: move templates to main LLM config tab, restyle (#813) 2024-09-30 17:15:11 +10:00
app FEATURE: Index embeddings using bit vectors (#824) 2024-10-14 13:26:03 -03:00
assets FEATURE: allow persona to only force tool calls on limited replies (#827) 2024-10-11 07:23:42 +11:00
config FEATURE: Tools for models from Ollama provider (#819) 2024-10-11 07:25:53 +11:00
db FEATURE: Index embeddings using bit vectors (#824) 2024-10-14 13:26:03 -03:00
discourse_automation FEATURE: allow llm triage to automatically hide posts (#820) 2024-10-04 16:11:30 +10:00
lib FEATURE: Index embeddings using bit vectors (#824) 2024-10-14 13:26:03 -03:00
public/ai-share UX: improve appearance of attributed quote when sharing (#665) 2024-06-11 12:06:57 -04:00
spec FEATURE: Tools for models from Ollama provider (#819) 2024-10-11 07:25:53 +11:00
test/javascripts FEATURE: allow persona to only force tool calls on limited replies (#827) 2024-10-11 07:23:42 +11:00
tokenizers FEATURE: Set endpoint credentials directly from LlmModel. (#625) 2024-05-16 09:50:22 -03:00
.discourse-compatibility DEV: Pin plugin for Discourse < 3.4.0.beta1-dev (#735) 2024-08-02 17:03:27 +08:00
.eslintrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.gitignore Initial commit 2023-02-17 11:33:47 -03:00
.npmrc DEV: Switch to use pnpm (#833) 2024-10-14 13:37:20 +02:00
.prettierignore FEATURE: UI to update ai personas on admin page (#290) 2023-11-21 16:56:43 +11:00
.prettierrc.cjs DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.rubocop.yml DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.streerc DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
.template-lintrc.cjs DEV: Update linting (#326) 2023-11-29 23:01:48 +01:00
Gemfile DEV: Update linting configs (#280) 2023-11-03 11:30:09 +00:00
Gemfile.lock Build(deps-dev): Bump rexml from 3.3.3 to 3.3.6 (#768) 2024-09-01 12:23:09 +02:00
LICENSE Initial commit 2023-02-17 11:33:47 -03:00
README.md CHORE: Update Readme (#185) 2023-09-04 15:46:35 -03:00
package.json DEV: Switch to use pnpm (#833) 2024-10-14 13:37:20 +02:00
plugin.rb DEV: Move composer AI helper to toolbar (#796) 2024-09-13 11:59:30 -07:00
pnpm-lock.yaml DEV: Switch to use pnpm (#833) 2024-10-14 13:37:20 +02:00
translator.yml UX: Display the indexing progress for RAG uploads (#557) 2024-04-09 11:03:07 -03:00

README.md

Discourse AI Plugin

Plugin Summary

For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco