Query Time-Series Vector Data with Hybrid Search
AI pack for hybrid search on time with Timescale Vector. Ideal for news, posts, and timestamped data.
Why it matters
Leverage Timescale Vector's hybrid search capabilities to retrieve relevant information from timestamped data, combining semantic similarity with time-based filtering for precise and timely results.
Outcomes
What it gets done
Perform hybrid search combining semantic relevance and time-based filtering.
Utilize LLM to dynamically set metadata filters, time ranges, and top-k values.
Efficiently store and query millions of vector embeddings in PostgreSQL.
Extract timely information from news articles, social media, changelogs, and more.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-pack-packs-timescale-vector-autoretrieval | bash Steps
Steps in the chain
Use llamaindex-cli to download the pack: llamaindex-cli download-llamapack TimescaleVectorAutoretrievalPack --download-dir ./tsv_pack. Inspect the files at ./tsv_pack and use them as a template for your own project.
Download the pack to ./tsv_pack directory using: from llama_index.core.llama_pack import download_llama_pack; TimescaleVectorAutoretrievalPack = download_llama_pack('TimescaleVectorAutoretrievalPack', './tsv_pack')
Configure pack arguments by importing necessary modules: from llama_index.core.vector_stores import MetadataInfo, VectorStoreInfo; from timescale_vector import client; from dotenv import load_dotenv, find_dotenv; import os; from datetime import timedelta. Create vector_store_info with content_info and metadata_info describing your nodes.
Overview
Timescale Vector AutoRetrieval Pack With Hybrid Search on Time
What it does
This pack demonstrates performing auto-retrieval for hybrid search based on both similarity and time, using the timescale-vector (PostgreSQL) vectorstore. The auto-retriever will use the LLM at runtime to set metadata filters (including deducing the time-ranges to search), a top-k value, and the query string for similarity search based on the text of user queries. That query will then be executed on the vector store.
How it connects
This sort of time-based retrieval is particularly effective for data where time is a key element of the data, such as: News articles, Blog posts, documentation, or other published materials (both public and private), Social media posts, Changelogs, Messages, Any timestamped data. Hybrid search of similarity and time method is ideal for queries that require sorting by semantic relevance while filtering by time and date. For instance: Finding recent posts about NVDA in the past 7 days or Finding all news articles related to music celebrities from 2020.
Source README
Description pending for li-pack-packs-timescale-vector-autoretrieval.
Step 1: Download TimescaleVectorAutoretrievalPack using CLI
Use llamaindex-cli to download the pack: llamaindex-cli download-llamapack TimescaleVectorAutoretrievalPack --download-dir ./tsv_pack. Inspect the files at ./tsv_pack and use them as a template for your own project.
Step 2: Download pack using Python code
Download the pack to ./tsv_pack directory using: from llama_index.core.llama_pack import download_llama_pack; TimescaleVectorAutoretrievalPack = download_llama_pack('TimescaleVectorAutoretrievalPack', './tsv_pack')Step 3: Set up pack arguments
Configure pack arguments by importing necessary modules: from llama_index.core.vector_stores import MetadataInfo, VectorStoreInfo; from timescale_vector import client; from dotenv import load_dotenv, find_dotenv; import os; from datetime import timedelta. Create vector_store_info with content_info and metadata_info describing your nodes.
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.