langchain-community
with pip install -qU langchain-community
to use this integration
Installation
To use the VLite in LangChain, you need to install thevlite
package:
Importing VLite
Basic Example
In this basic example, we load a text document, and store them in the VLite vector database. Then, we perform a similarity search to retrieve relevant documents based on a query. VLite handles chunking and embedding of the text for you, and you can change these parameters by pre-chunking the text and/or embeddings those chunks into the VLite database.Adding Texts and Documents
You can add texts or documents to the VLite vector database using theadd_texts
and add_documents
methods, respectively.
Similarity Search
VLite provides methods for performing similarity search on the stored documents.Max Marginal Relevance Search
VLite also supports Max Marginal Relevance (MMR) search, which optimizes for both similarity to the query and diversity among the retrieved documents.Updating and Deleting Documents
You can update or delete documents in the VLite vector database using theupdate_document
and delete
methods.
Retrieving Documents
You can retrieve documents from the VLite vector database based on their IDs or metadata using theget
method.