LangChain.VectorStore (langchainex v0.2.3)
## VectorStore Genserver, provides all the services for storing and searching vectors
You can specify a provider when you launch the GenServer in your Application tree, so you can have multiple VectorStore servers running in your application, each with a different provider.
## options: :provider -- the actual vector db provider you are using, must implement the VectorStore.Provider protocol :embed_documents -- optional function for embedding multiple docs presented as strings :embed_query -- optional function for embedding a single query when presented as a string
Link to this section Summary
Functions
Add a list of vectors to the vector store.
Returns a specification to start this module under a supervisor.
Callback implementation for GenServer.init/1
.
load a vector store from a directory
perform a similarity search on the vector store if query is a string it will be run through embed_query first
perform a similarity search on the vector store and return score if query is a string it will be run through embed_query first
Link to this section Functions
add_documents(pid, document_list)
add_vectors(pid, vector_list)
Add a list of vectors to the vector store.
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
init(arg)
Callback implementation for GenServer.init/1
.
load(pid, directory, embeddings)
load a vector store from a directory
similarity_search(pid, query, k, filter)
perform a similarity search on the vector store if query is a string it will be run through embed_query first
similarity_search_with_score(pid, query, k, filter)
perform a similarity search on the vector store and return score if query is a string it will be run through embed_query first