discourse-ai/db/migrate/20240409035951_add_rag_params_to_ai_persona.rb
Sam f6ac5cd0a8
FEATURE: allow tuning of RAG generation (#565)
* FEATURE: allow tuning of RAG generation

- change chunking to be token based vs char based (which is more accurate)
- allow control over overlap / tokens per chunk and conversation snippets inserted
- UI to control new settings

* improve ui a bit

* fix various reindex issues

* reduce concurrency

* try ultra low queue ... concurrency 1 is too slow.
2024-04-12 10:32:46 -03:00

12 lines
545 B
Ruby

# frozen_string_literal: true
class AddRagParamsToAiPersona < ActiveRecord::Migration[7.0]
def change
# the default fits without any data loss in a 384 token vector representation
# larger embedding models can easily fit larger chunks so this is configurable
add_column :ai_personas, :rag_chunk_tokens, :integer, null: false, default: 374
add_column :ai_personas, :rag_chunk_overlap_tokens, :integer, null: false, default: 10
add_column :ai_personas, :rag_conversation_chunks, :integer, null: false, default: 10
end
end