Future-House / paper-qa

High accuracy RAG for answering questions from scientific documents with citations
Apache License 2.0
6.44k stars 617 forks source link

When the agent is initialized #677

Closed bytesculptors closed 1 week ago

bytesculptors commented 1 week ago

Hello, I'm reading the paper https://arxiv.org/pdf/2312.07559v2, in the Method section -> Tools -> search, the authors write "This tool is always executed once with the full-text question before initializing the agent." I thought the agent is the one who do the search, so why is the search executed before initializing the agent?

jamesbraza commented 1 week ago

Hello @bytesculptors yes thanks for the good question.

The agent is the one choosing tools yes, we just called the paper_search tool once before actually letting the agent start running. This was called "pre search".

Also, note the paper you linked is the original PaperQA paper. This "pre search" capability was not used in PaperQA2 (https://arxiv.org/abs/2409.13740). As v5 of this repo (current version) is associated with the PaperQA2 paper, that's why this logic isn't in our current runner code: https://github.com/Future-House/paper-qa/blob/v5.3.2/paperqa/agents/main.py#L120-L133

Does that make sense?

bytesculptors commented 1 week ago

Yes, I got this, I use v5 but I read the old paper :( Thank you!!

jamesbraza commented 1 week ago

Yep no problem. Going to close this out, feel free to open another issue or ask follow up questions