Skip to content

feat: import uploaded documents as intel items - #86

Open
pranavsant wants to merge 4 commits into
pranav/improveWebsiteFilterfrom
pranav/implementPDFscraping
Open

pranavsant wants to merge 4 commits into
pranav/improveWebsiteFilterfrom
pranav/implementPDFscraping

Conversation

@pranavsant

@pranavsant pranavsant commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

🦸 What's new in this PR

Description

  • Users can now upload a PDF, TXT, DOCX, or EPUB and turn it into an intel item

  • Uploaded files and full document text are discarded after being processed

  • Relevance filtering is skipped

  • Existing intelligence extraction and saving code is reused

  • Save imports under one "Uploaded documents" source

  • Still prevents duplicates

  • Source URLs and publication dates are optional

  • Database changes make source URLs optional and add the upload filename and a hash for duplicate detection.

Screenshots

Screen.Recording.2026-11-18.at.1.08.30.PM.mov

🕵️ How to review

Look through upload flow:

  • components/intelligence-library/DocumentUpload.tsx — upload form.
  • app/(authenticated)/(approved)/intelligence/upload/route.ts — authentication and request validation
  • lib/intelligence-library/process-document.ts — starts the Python worker and handles its response.

Look through document processing:

  • scripts/documents/extract.py — extracts text from PDF, TXT, DOCX, and EPUB files.
  • scripts/documents/cli.py — checks duplicate file hashes, generates intelligence without relevance filtering, and summarizes longer documents.
  • scripts/intelligence/extractor.py — shared AI request and intelligence-standardization code.

🪜 Next steps

  • Not sure but current limitations are:
    • 8 MB per file
    • 120,000 extracted characters
    • text-based PDFs only, no OCR

Related PRs

CC: @Kulieshova

@pranavsant
pranavsant added this pull request to stack #60 November 19, 2026 06:19
@vercel

vercel Bot commented Nov 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zero-abuse-project Ready Ready Preview Nov 19, 2026 6:20am UTC

This branch was successfully deployed

1 active deployment
Preview — 1e6d3f76 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant