Upstash Documentation

LlamaIndex with Upstash Vector

1 min read

You can use LlamaIndex with Upstash Vector to perform Retrieval-Augmented Generation (RAG). LlamaIndex is a powerful tool that integrates seamlessly with vector databases like Upstash Vector, enabling advanced query and response capabilities.

Install#

Setup#

First, create a Vector Index in the Upstash Console. Configure the index with:

  • Dimensions: 1536
  • Distance Metric: Cosine

Once the index is created, copy the UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN and add them to your .env file along with your OpenAI API key:

Usage#

Here’s how you can integrate LlamaIndex with Upstash Vector:

Querying#

Once the index is created, you can query it to retrieve and generate responses based on document content.

Notes#

  • You can specify a namespace when creating the UpstashVectorStore instance:

  • Visit the LlamaIndex documentation for more details.