Vector Search
The retrieval.vectorSearch
indexes the input files using embeddings into a vector database that can be used for similarity search. This is commonly referred to as Retrieval Augmented Generation (RAG).
The returned value is an array of files with the resconstructed content from the matching chunks.
Model configuration
The computation of embeddings is done through the LLM APIs using the same authorization token as the LLM API.
The default model is openai:text-embedding-ada-002
but you can override the model using embedModel
.
You can further customize the embedding generation by using chunkSize
and chunkOverlap
.
Index name
If you modify the model or chunking configurations, you will want to create separate index databases.
Installation requirements
The retrieval uses LLamaindex TS for indexing and searching.
The llamaindex
package will be automatically installed.