Embeds every chunk with a small encoder and stores the vectors next to the
chunks. By default the encoder is BAAI/bge-small-en-v1.5 (about 130 MB,
downloaded once); a set whose text is mostly not English is indexed with
intfloat/multilingual-e5-small instead. On German medicine product
information (8 documents, 58 questions) it put the passage a question came
from in the top four results for 55 percent of questions, against 45
percent for the English model.
dragon_documents() does this for you unless index = FALSE; call this
after editing files, or to switch encoders. Nothing is re-embedded when the
chunks have not changed.
Examples
if (interactive()) {
docs <- dragon_documents(dragon_example_documents(), name = "policies", index = FALSE)
docs <- dragon_index(docs)
}
