Support Pinecone-style two-line API for Upstash vector indexes #8286
Aayush1Singh
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Currently, LangChain requires manual setup of index to use Upstash Vector as compared to easy setup of indexes for Pinecone.This is more cumbersome than Pinecone’s API. I propose adding a first-class Upstash client class in LangChain (e.g. in langchain_community) with a simple two-line API. For example:
Motivation
Knowing the URL and token beforehand of a dynamically created Index is impossible without manual feeding/using REST API
I was working on a RAG based application and needed a vector database that stores embeddings with indexes, So while developing the application, I first used RedisVectorStore (on localhost) from langchain community as it worked very smooth.
When i went to deploy my application, i migrated to PineconeVectorStore and the migration was very smooth because the interface was nearly same as RedisVectorStore with a minor change of creation of a index object(specified in feature request), but due to Pinecone limitations of only providing for a limited indexes in its free tier, I decided to migrate to Upstash Redis.
Now here comes the problem, Though the interface for the PineCone and Upstash looks similar, Upstash requires the url and token of the index instead of index name(specified in below), and i needed to dynamically create indexes and retreive context, for which knowing url and token beforehand is impossible without manual feeding.
So i had to read through upstash documentation and make use REST API of upstash to first get the index's url and token and then to be able to create a Index object and use it similarly to Pinecone
Current Upstash Workflow vs Pinecone
Right now Upstash integration in LangChain requires three separate steps:
Index(url, token)
.UpstashVectorStore(...)
.In contrast, Pinecone works like this:
1.Define a Pinecone object
2.Pass the index name
3.Declare the vectorStore
That extra boilerplate breaks the drop-in promise and clutters application code compared with Pinecone.
Why this matters
Proposal (If applicable)
I suggest implementing an Upstash client class that parallels Pinecone. Example usage:
up = Upstash(email="[email protected]", api_token="UPSTASH_API_KEY")
index = up.Index("my-index")
vectorstore = UpstashVectorStore(
embedding=embedding,
index_url=os.getenv("UPSTASH_VECTOR_REST_URL"),
index_token=os.getenv("UPSTASH_VECTOR_REST_TOKEN"),
index=index,
)
Internally, this client would automate the index setup:
Beta Was this translation helpful? Give feedback.
All reactions