Find answers from the community

Updated 3 months ago

Handling date and price related queries in vector search

At a glance

The community member is asking how to perform vector search on date-related queries, such as listing invoices starting from October 2023, invoices raised in the last quarter, invoices between April 2024 and July 2024, invoices with total amounts exceeding or lower than a certain amount, and comparing the latest invoice from a vendor with an invoice from the last quarter.

The comments suggest that an LLM (Large Language Model) would be needed to infer the metadata filters for the vector search. One community member clarifies that an LLM can be used to understand the query and extract the metadata filters, either by using an NLP library like SpaCy or a BERT model to extract entities, or by calling a GPT API. After applying the filters, the vector search can be performed on the database for more fine-grained results.

Hi,

How can we perform vector search on date related queries like
  1. List invoices starting from oct 2023
  2. List invoices raised in last quarter
  3. Invoices between apr 24 to jul 24
  4. Invoices with total amount exceed/lower by x amount
  5. Compare the latest invoice raised by ABC vendor with invoice from last quarter
How do you guys are handling these kind of dates, price related queries
L
k
t
4 comments
You need an LLM to be able to infer metadata filters for your vector search
I would be interested in some pointers here too. Not sure I understand you @Logan M would you mind clarifying a bit?
he means to say that, you need an LLM to understand the query and extract metadata filters data
Usually this can be done in 2 ways
  1. Using NLP library like SpaCy or with BERT model to extract entities
  2. By calling gpt through api calls
Then after applying filter search + vector search on database for more fine grained results
Thanks for clarifying!
Add a reply
Sign up and join the conversation on Discord