| Name | Type | Description |
|---|---|---|
text_key | str | Default: 'text'Key to store the text in metadata. |
index | Optional[Index] | Default: NoneUpstashVector Index object. |
async_index | Optional[AsyncIndex] | Default: None |
index_url | Optional[str] | Default: None |
index_token | Optional[str] | Default: None |
embedding | Optional[Union[Embeddings, bool]] | Default: None |
namespace | str | Default: '' |
Upstash Vector vector store
To use, the upstash-vector python package must be installed.
Also an Upstash Vector index is required. First create a new Upstash Vector index
and copy the index_url and index_token variables. Then either pass
them through the constructor or set the environment
variables UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN.
Example:
.. code-block:: python
from langchain_openai import OpenAIEmbeddings from langchain_community.vectorstores import UpstashVectorStore
embeddings = OpenAIEmbeddings(model="text-embedding-3-large") vectorstore = UpstashVectorStore( embedding=embeddings, index_url="...", index_token="..." )
import os
os.environ["UPSTASH_VECTOR_REST_URL"] = "..." os.environ["UPSTASH_VECTOR_REST_TOKEN"] = "..."
vectorstore = UpstashVectorStore( embedding=embeddings )
UpstashVector AsyncIndex object, provide only if async
URL of the UpstashVector index.
Token of the UpstashVector index.
Embeddings object or a boolean. When false, no embedding is applied. If true, Upstash embeddings are used. When Upstash embeddings are used, text is sent directly to Upstash and embedding is applied there instead of embedding in Langchain.
Namespace to use from the index.