Find answers from the community

Updated 3 months ago

Hi @Logan M , how I can control how

Hi , how I can control how many questions are generated for subquery engine and for QueryEnginetTool metadata, name is used in this process in any way or just description is takeing in consideration ?
Plain Text
# setup base query engine as tool
query_engine_tools = [
    QueryEngineTool(
        query_engine=vector_query_engine,
        metadata=ToolMetadata(
            name="pg_essay",
            description="Paul Graham essay on What I Worked On",
        ),
    ),
]
L
J
18 comments
It's using name + description of each query engine, plus the user query to generate sub-questions

This is actually the prompt template
Attachment
image.png
I don't see a way to limit questions besides editing the tempate, which is used in the question generator module
can I use custom prompt for this ?
You should be able to do something like

Plain Text
from llama_index.prompts import PromptTemplate

prompts_dict = query_engine.get_prompts()
print(list(prompts_dict.keys()))

prompt_tmpl_str = ...
prompt_tmpl = PromptTemplate(prompt_tmpl_str)

query_engine.update_prompts(
    {"...": prompt_tmpl }
)
many thanks I will try
how each subquestion is processed ? there is a separate call to query_engine, If I use vector_query_engine and have configured to use 4 chunks, for each subquestion will retrieve different chunks and send to LLM?
Each sub question + response and the original user query is sent to the LLM to produce a final response
Each response+sub question is turned into a "node"
Attachment
image.png
Then all those nodes + original query is sent to the response synthesizer
Attachment
image.png
ok, what I don't understand is if for user question I retrieve 4 chunks from my database, this 4 chunks will be used for all sub question? or for each sub-question it take different chunks ?
Think of it this way
πŸ§‘β€πŸŽ¨
It's running entire query engines under the hood for each sub question
super, is more clear now, Thank you
@Logan M I'm having some issues configuring this. I'm getting this type of messages "Unfortunately I do not have enough context in the provided tools and user question to generate relevant sub-questions.

I do not have enough information to break this down into sub-questions.

The provided tools do not seem directly related to answering the user's question about whether <my question>. To provide helpful sub-questions, I would need more details on the specific tools available and how they could assist ..... Please provide additional context about the tools and their relation to address the user's question." Are this related with information provided in description here query_engine=vector_query_engine,
metadata=ToolMetadata(
name="pg_essay",
description="Paul Graham essay on What I Worked On",
) ?
Add a reply
Sign up and join the conversation on Discord