Find answers from the community

Updated 3 months ago

Hi @Logan M could you please help wrt

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 ?
L
R
A
8 comments
You can create 100 tools, but at that point, you should be using some tool retrieval
why don't you just index the pdfs into a vector db, and then use one retrieval tool. IF you need to separate between the indexed PDF info, use metadatafilters
That works too, each tool can be a retriever setup with certain filters. I think they were talking about scaling in terms of the LLM being able to select the proper query engine
100 tools, that's like a dream πŸ˜„
you'll need a really capable model to control that
Yea that's why I recommend a tool retriever, to help narrow down the choices for the llm
Hi @Logan M could you please poin me any LlamaIndex implementation of tool retriever ?
Add a reply
Sign up and join the conversation on Discord