Skip to content

[Question]: Can I past a list of query strings to query_engine.query() or query_engine.retrieve() i.e., batch query/retrieve? #7218

Description

@kevon217

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

It's not entirely clear to me if a RetrieverQueryEngine() supports batch queries. I'm not using an LLM and just want to retrieve semantically similar results.

My query engine for my chromdb index is defined as follows:

index = VectorStoreIndex.from_vector_store(vector_store=vector_store,storage_context=storage_context, service_context=service_context,)

retriever = VectorIndexRetriever( index=index, similarity_top_k=cfg.semantic_search.query.similarity_top_k, vector_store_query_mode="text_search", )

response_synthesizer = get_response_synthesizer( response_mode="no_text", service_context=service_context )

rerank = SentenceTransformerRerank( model=cfg.semantic_search.query.rerank.cross_encoder.model_name, top_n=cfg.semantic_search.query.rerank.cross_encoder.top_n, )

query_engine = RetrieverQueryEngine( retriever=retriever, response_synthesizer=response_synthesizer, node_postprocessors=[DummyNodePostprocessor(), rerank], )

My hope was that I could pass a list of query strings as follows:

results_q = query_engine.query(queries)
OR
results_r = query_engine.retriev(queries)

Do async methods apply at all?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions