You can use LlamaParse with Upstash Vector to parse documents and perform semantic queries on the content. LlamaParse simplifies the extraction of structured information from files, which can then be indexed and queried using Upstash Vector.
Once the document is parsed, you can index it using Upstash Vector and query its content:
Copy
Ask AI
from llama_index.core import VectorStoreIndexfrom llama_index.vector_stores.upstash import UpstashVectorStorefrom llama_index.core import StorageContextfrom dotenv import load_dotenvimport os# Load environment variablesload_dotenv()# Set up Upstash Vector Storevector_store = UpstashVectorStore( url=os.getenv("UPSTASH_VECTOR_REST_URL"), token=os.getenv("UPSTASH_VECTOR_REST_TOKEN"))# Create storage context and index the parsed documentstorage_context = StorageContext.from_defaults(vector_store=vector_store)index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)# Perform a queryquery_engine = index.as_query_engine()response = query_engine.query("What is the main topic discussed in the document?")