Use cases/Knowledge & Research

PDF Research Helper

Drop a PDF — contracts, papers, manuals — and chat with it. Flowly extracts text, indexes, answers questions with page citations.

Knowledge & Researcheasy~10m setup
Tools
read_fileexecmemorymemory_search
Channels
desktoptelegram

PDFs are the most-shared and least-searchable document format. Reading a 60-page contract or research paper to find one clause is 30 minutes of skimming. The agent can extract the text once, index it semantically, and answer questions in seconds — with page citations so you can verify.

What it does

  • Accept any PDF (drop in a chat message or via filesystem)
  • Extract text via pdftotext or pymupdf (preserves page boundaries)
  • Index in memory with page-level metadata
  • Answer questions with citations: "On page 12: 'Notice period is 60 days unless...'"
  • Compare two PDFs side-by-side
  • Extract structured data: tables, definitions, numbered clauses

What you'll need

  • pdftotext (brew install poppler on Mac, apt install poppler-utils on Linux) OR Python pymupdf (pip install pymupdf)
  • Read file, exec, memory tools — built in
  • The PDF accessible to the agent's filesystem

Setup

1. Verify the extractor

bash
pdftotext -v # poppler version 22+ recommended

Or:

bash
python3 -c "import fitz; print(fitz.__version__)" # PyMuPDF

2. Set the PDF protocol

Send to Flowly
When I share a PDF (path or attachment): 1. Extract text via pdftotext, preserving page boundaries: pdftotext -layout <file> - | awk -v RS='\f' '...' Or via PyMuPDF: for page in doc: yield (page.number+1, page.get_text()) 2. For each page, save to memory tagged "pdf:<basename>:page:<n>" with the full page text and a 1-line summary. 3. Reply with: filename, page count, type (contract / paper / manual / report — infer from headings), 3-line synopsis. 4. From there I'll ask questions. Always cite page numbers. Use: memory_search("pdf:<basename>:* <my-question>") to retrieve relevant pages, then synthesise.

3. Try it

"Read /Users/me/contracts/lease-agreement.pdf"

Agent extracts, indexes, replies:

Indexed lease-agreement.pdf (47 pages, contract). Synopsis: 12-month residential lease, automatic 30-day renewal, fixed rent with 3% annual escalator, security deposit 1.5x monthly rent. Notable: clause 14 restricts subletting entirely.

"What's the notice period for ending the lease early?"

Agent:

Page 23, clause 8.2: "Tenant may terminate this Agreement with no less than 60 days written notice…" Page 31, clause 12.4: A 2x monthly rent penalty applies if termination occurs in months 1–6. Combined: 60 days notice required, plus penalty if you leave in the first 6 months.

4. Multi-PDF comparison

"Compare lease-agreement.pdf to standard-tenant-rights.pdf. Highlight clauses where they conflict."

Agent loads both, finds clauses with overlapping topics, runs them side-by-side, surfaces conflicts.

Tips

  • -layout matters. Without -layout, pdftotext breaks tables and numbered lists. With it, structure is mostly preserved.
  • Scanned PDFs need OCR. If text extraction returns garbage, the PDF is image-based. Use tesseract on each page first.
  • Cite, always. No claim about a PDF's content without a page citation. AI without sources lets hallucinations slip in.
  • Index per-PDF. Don't dump everything into one bucket. Tag by basename so questions stay scoped to the right document.
  • Privacy: local extraction. Don't send PDFs to cloud services unless you trust the vendor. pdftotext and pymupdf are local and fast.
  • Pair with a reading queue. "When I get a new PDF, ask me whether to read now or queue for later." Stops the inbox of stale unread research.