Find answers from the community

A
Anuj
Offline, last seen 3 months ago
Joined September 25, 2024
Hi is there any way to get only subqueries from this?
https://docs.llamaindex.ai/en/stable/examples/query_engine/sub_question_query_engine/

at present Sub Question Query Engine brreaks down complex quesytion into subquestions and then generate answers for these subquestions and finally combined refined response.
I just need subqueries generated . I dont want to use resource for response generation.
Is there any way to achieve this ?
1 comment
W
Hi could you please help wrt below query :

I am not sure what should be best way to handle number of tools when out PDFs are much more lets say 100-200 PDFs in below case:

input_dir = './data/netwrok_pdf/'
pdf_nw=SimpleDirectoryReader(input_dir=input_dir).load_data()

build index and query engine
vector_query_engine = VectorStoreIndex.from_documents(
pdf_nw,
use_async=True,
).as_query_engine()

vecto_tool = QueryEngineTool.from_defaults(
query_engine=vector_query_engine,
description=(
"Useful for retrieving specific context related to the netwrok paper."
)
)

query_egine = RouterQueryEngine(
selector=LLMSingleSelector.from_defaults(),
query_engine_tools=[vecto_tool],
verbose=True,
)

Now lets say I have 100 more PDFs then shall we create 100 seperate tool for each PDF?
If yes then it does not seems to be scalable ?
8 comments
A
L
R
I am not sure what should be best way to handle number of tools when out PDFs are much more lets say 100-200 PDFs in below case:

input_dir = './data/netwrok_pdf/'
pdf_nw=SimpleDirectoryReader(input_dir=input_dir).load_data()

build index and query engine

vector_query_engine = VectorStoreIndex.from_documents(
pdf_nw,
use_async=True,
).as_query_engine()

vecto_tool = QueryEngineTool.from_defaults(
query_engine=vector_query_engine,
description=(
"Useful for retrieving specific context related to the netwrok paper."
)
)

query_egine = RouterQueryEngine(
selector=LLMSingleSelector.from_defaults(),
query_engine_tools=[vecto_tool],
verbose=True,
)

Now lets say I have 100 more PDFs then shall we create 100 seperate tool for each PDF?
If yes then it does not seems to be scalable ?
3 comments
A
k
how can I add additional pdf/document to existing VectorStoreIndex(). I could not find anything like add_documents().
Below is my script :

input_dir = './data/cisco_pdf/'
some_docs = SimpleDirectoryReader(input_dir=input_dir).load_data()

build index and query engine

vector_query_engine = VectorStoreIndex.from_documents(
some_docs,
use_async=True,
).as_query_engine()

Now I need to add 1 more pdf and i want to update my index for this additional PDF. could you please help here ?
5 comments
k
A
@here I see Sub Question Query Engine module generates sub query and their synthesized answer as part of output.
Is there any way so that I can get only SubQueries ?
4 comments
A
L
@kapa.ai is there any agentic example based on :
1) text 2 sql where query(incoming text) might come such that "agent need to work on CoT, by checking if incoming text need 1 or multiple tables to get an anwer ?
2) query may have date related details also like "what are bugs raised in last 1 month?"
2) if multiple table are required then fetch data from those tables
3) combine data and rteturn response.
4 comments
A
k
@kapa.ai is there anything in LlamaIndex where I could generate questions from multiple PDF's?
2 comments
k