#292 — Modify vector_search to be able to run multiple queries on one call
Repo: Twill-AI/facade State: open | Status: open Assignee: meliascosta
Created: 2025-02-26 · Updated: 2025-02-27
Description
Request
Caused by need to run multi-collection RAG queries
In order to optimize total query run time we want to be able to combine 2 or more calls to the vector DB into a single one:
vector_search(collection="a", query="foo", k=3, filters={}) # returns list with 3 results
vector_search(collection="b", query="bar", k=4, filters={"field": "genre", "$neq": "Drama"}) # returns list with 4 resultswould transform into:
queries = [
{collection="a", "query":"foo", "k": 3, "filters":{} },
{collection="b", "query":"bar", "k": 4, "filters":{"field": "genre", "$neq": "Drama"} }
]
vector_search(queries) # returns list of 2 lists, first has 3 results, second 4.Acceptance criteria
-
vector_searchfunction has been modified to receive multiple queries about different collections and executes them all on the same query. - Tests have been modified to address the new use cases
Notes
Add implementation notes, blockers, and context here
Related
Add wikilinks to related people, meetings, or other tickets