pip install upstash-vector
.
The Upstash Vector integration in langchain is a wrapper for the Upstash Vector Python SDK. That’s why the upstash-vector
package is required.
UpstashVectorStore
object using credentials from the Upstash Console.
You also need to pass in an Embeddings
object which can turn text into vector embeddings.
UpstashVectorStore
is to pass embedding=True
. This is a unique
feature of the UpstashVectorStore
thanks to the ability of the Upstash Vector indexes
to have an associated embedding model. In this configuration, documents we want to insert or
queries we want to search for are simply sent to Upstash Vector as text. In the background,
Upstash Vector embeds these text and executes the request with these embeddings. To use this
feature, create an Upstash Vector index by selecting a model
and simply pass embedding=True
:
Embeddings
object.
Most embedding models can embed multiple documents at once, so the documents are batched and embedded in parallel.
The size of the batch can be controlled using the embedding_chunk_size
parameter.
The embedded vectors are then stored in the Upstash Vector database. When they are sent, multiple vectors are batched together to reduce the number of HTTP requests.
The size of the batch can be controlled using the batch_size
parameter. Upstash Vector has a limit of 1000 vectors per batch in the free tier.
filter
parameter which will allow you to filter by metadata:
pendingVectorCount
represents the number of vector that are currently being indexed.
pip install upstash-redis
upstash-redis
Python SDK being utilized as wrappers for LangChain.
This SDK utilizes Upstash Redis DB by giving UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN parameters from the console.