DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to find the page that answers a question in a long PDF with Jev Doc Search

Searches a 300-page report by tree, then returns the pages that answer your question.

  • Top pick
  • Research
  • Intermediate
  • 45 minutes
  • From the README
  • Any agent

Credentials. The script needs two API keys set as environment variables, so keep them out of shared code and shell history.

Credentials. The PDF is uploaded to the cloud PageIndex service, so do not send confidential documents you are not allowed to share with that service.

Who it is forAn analyst or developer with a long annual report or technical PDF who needs the exact page for a specific figure, and who is past the point where one request can hold every page.

The problemA single multiple-choice request cannot hold every page of a long document, so flat page search fails on reports over a few dozen pages.

The outcomeThe script prints the sections and pages it kept, so you can open the right page of the report and check the figure.

What you need first

  • Python with pip available
  • A TypeSafe API key from the TypeSafe console
  • A PageIndex API key from the PageIndex dashboard
  • The PDF you want to search

Steps

  1. Run pip install -r requirements.txt in the repo folder.
  2. Run export TYPESAFE_API_KEY="..." and replace the value with your TypeSafe key.
  3. Run export PAGEINDEX_API_KEY="..." and replace the value with your PageIndex key.
  4. Run python tree_search.py NVIDIA_10K.pdf "What was NVIDIA's total revenue for fiscal year 2026?" with your own PDF and question.
  5. Note the printed doc_id, then ask another question with python tree_search.py pi-... "<your question>" so the PDF is not uploaded again. (inferred, check the README)

Prompt for your agent

Using the repo VectifyAI/jev-doc-search, run tree_search.py on <path-to-pdf> with the question <question>. Report the sections and pages it kept and the doc_id. Verify by opening the first kept page of the PDF and confirming the figure or claim appears there.

Caveat. The README tests tree search on two annual reports and two questions, so verify each returned page against the source document before relying on it.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page