Upstash
Upstash is a simple way to store your documents in an Upstash vector database and then find the ones that best match a query. It lets you add new documents, search for similar ones, or just get a retriever that can be used elsewhere in your workflow.
How it Works
When you use Upstash, the component talks to the Upstash API.
- Add – It takes the documents you give it, turns them into vectors (using an embedding model if you provide one, or Upstash’s own embeddings if you don’t), and uploads them to the Upstash index.
- Search – It sends your search query to Upstash, asks for the most similar vectors, and returns the matching documents.
- Retriever – It builds a retriever object that can be plugged into other parts of your workflow to fetch relevant documents on demand.
All communication is done over HTTPS, so your data stays secure as long as you keep your Upstash credentials safe.
Operations
This component offers several operations that you can select based on what you need to do. You can only use one operation at a time:
- Add: Store new documents in the Upstash vector store.
- Search: Find documents that are most similar to a given query.
- Retriever: Create a retriever object that can be used to fetch relevant documents later.
To use the component, first select the operation you need in the “Operation” field.
Inputs
Input Fields
The following fields are available to configure this component. Each field may be visible in different operations:
-
Credential: Select the Upstash API credential you have set up in Nappai.
- Visible in: Add, Search, Retriever
-
Embedding: To use Upstash’s embeddings, don’t provide an embedding.
- Visible in: Add, Search, Retriever
-
Ingest Data: The documents you want to add to the vector store.
- Visible in: Add
-
Operation: Choose which operation to perform (Add, Search, or Retriever).
- Visible in: Add, Search, Retriever
-
Number of Results: Number of results to return.
- Visible in: Add, Search, Retriever
-
Search Query: Enter a search query. Leave empty to retrieve all documents.
- Visible in: Search
-
Text Key: The key in the record to use as text.
- Visible in: Add, Search, Retriever
Important: Before using this component, you must first create an Upstash API credential in Nappai’s credential section. The credential must contain the Index URL and Index Token for your Upstash index. Once the credential is created, select it in the “Credential” field above.
Outputs
- Retriever: A retriever object that can be used to fetch relevant documents in later steps.
- Results: A list of documents that match the search query.
- Vector Store: The underlying Upstash vector store object, useful if you need to perform advanced operations later.
Usage Example
Adding Documents
- Operation: Add
- Ingest Data: Provide a list of documents (e.g., from a CSV or database).
- Embedding: Leave blank to use Upstash’s embeddings.
- Click Run – the documents are stored in Upstash.
Searching Documents
- Operation: Search
- Search Query: “How to set up a CI/CD pipeline?”
- Number of Results: 5
- Click Run – the component returns the 5 most relevant documents.
Related Components
- Pinecone Vector Store – Another cloud vector database option.
- OpenAI Embeddings – Generate embeddings locally before sending to a vector store.
- Retriever – A generic retriever component that can work with any vector store.
Tips and Best Practices
- Use a dedicated Upstash index for each project to keep data organized.
- If you already have embeddings, provide them to speed up the Add operation.
- Keep the number of results reasonable (e.g., 4–10) to avoid overwhelming downstream components.
- Regularly back up your Upstash data if it contains critical information.
Security Considerations
- Store your Upstash credentials in Nappai’s secure credential store; never hard‑code them in your workflow.
- Ensure that only authorized users have access to the credential and the component.
- Use HTTPS (the default) to protect data in transit between Nappai and Upstash.