Credentials. The script needs a TypeSafe API key set as an environment variable, so keep it out of shared files.
Who it is forAn HR or operations person with a short handbook or policy PDF who wants the page for a question like vacation days, without reading the whole file.
The problemScanning a short PDF page by page to answer one policy question wastes time, and the document is short enough for a single Choice.
The outcomeThe script prints the most likely page label and its text, which you can read directly.
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
- Run
pip install -r requirements.txtin the repo folder. - Run
export TYPESAFE_API_KEY="..."and replace the value with your TypeSafe key. - Run
python page_search.py handbook.pdf "How many vacation days do new employees get?"with your own PDF and question. - Read the printed page and its text to confirm it contains the policy.
Prompt for your agent
Using the repo VectifyAI/jev-doc-search, run page_search.py on <path-to-pdf> with the question <question>. Output the most likely page label and its text. Verify that the page text contains the answer by checking the wording against the PDF.
Caveat. Flat page search only works while the whole document fits in one request, which the README puts at a few dozen pages, so use tree_search.py for longer PDFs.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for VectifyAI/jev-doc-search and "Locate the handbook page that answers an HR question"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer