😫 The Pain Point
“Find me the contract from last year that mentioned ‘Penalty 8%’.” You have 200 contracts. Windows Search is unreliable with PDF contents. You have to open them one by one.
🚀 Agentic Solution
Local Search Engine: Indexes the text inside every page of every PDF and finding matches instantly.
Key Features:
- Snippets: Shows you the text surrounding the keyword (context).
- Page Number: Tells you exactly where to look (e.g., “File A.pdf - Page 5”).
⚔️ Phase 1: Commander (Quick Fix)
For a quick search.
Prompt:
“Search for ‘Penalty 8%’ in all PDF files in this folder. Print the filename, page number, and the sentence containing the keyword.”
Result: A list of hits.
🏗️ Phase 2: Architect (Permanent Tool)
For Legal/Research.
Engineering Prompt:
**Role:** Python Utils Developer
**Task:** Create a "Deep PDF Search Tool".
**Requirements:**
1. **GUI:**
* Select Folder.
* Input Search Query.
* "Search" button.
2. **Output:**
* List of results: `Filename - Page N - Preview Text`.
* Double-click to open file.
3. **Logic:**
* Iterate PDFs.
* Extract text page by page.
* Find keyword -> Save context (20 chars before/after).
4. **Deliverables:** `pdf_search.py`, `run.bat` (Windows), `run.sh` (Mac).
🧠 Prompt Decoding
- Preview Text: Knowing “File A has a match” isn’t enough. Seeing “…subject to a penalty of 8% if late…” helps you decide if it’s the right document without opening it.
🛠️ Instructions
- Copy Prompt -> Paste -> Run.
- Select Folder -> Type “Keyword” -> Search.