Skip to content

feat: improve website filtering when crawling - #59

Open
pranavsant wants to merge 9 commits into
mainfrom
pranav/improveWebsiteFilter
Open

pranavsant wants to merge 9 commits into
mainfrom
pranav/improveWebsiteFilter

Conversation

@pranavsant

@pranavsant pranavsant commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #54

🦸 What's new in this PR

Description

  • New way for sites to be scraped/avoided
  • Here's how it works:
    • Requirements for article section and date based URLs were removed, we don't want to limit ourselves to strictly things that are under the article sections on a news website
    • Some websites are classified as discovery pages / urls, meaning that they don't really have content themselves but they have links to the content. One example could be a general page like https://theonion.com/news/
      • the world news page doesn't have content on its own, but it has plenty of links to articles that might
      • We still scrape these discovery pages, but instead of storing them as intel items we only use them to find more links to add to the queue. These do count for max depth and max pages
    • Once we scrape an article and get its data, we do this:
    • First, there is a new cache that remembers previous relevance decisions for urls. The way it identifies is by creating a hash code for the content of any visited page, then when we find a url we just check if the has matches with anything under that url.
      • This way, if the content of a page changes we will check it again
      • If we find the article in the cache, then we can just reuse the previous decision we made the last time we saw it (if it's irrelevant, don't store; if it's relevant, only add it as intel item if it has somehow been deleted from intel items and is still relevant, decided in later steps)
    • If we can't find the page in the cache, then we move on to a short screening with a call to an LLM
      • We give the model these things
        • Title: up to 256 characters
        • Meta description: up to 512 characters
        • Opening article text: up to 1200 characters
      • If the screening says it's irrelevant, then we add the page to the cache as a rejection and move on
      • If the screening says it could be relevant, is uncertain, or fails, then we move to the next step
    • The last step is full assessment with the full content of the page
      • If relevant, save as intel item and cache
      • If not, cache rejection

🕵️ How to review

  • Look through scripts/scraper/crawler.py - URL filtering is way broader
  • scripts/intelligence/screening.py - reject clearly irrelevant pages with preview
  • scripts/ingestion/pipeline.py, cache.py, and repository.py - cache checks happen to check if it has been seen before
  • processed_pages schema and migration for adding a place where we can keep track of previously seen pages

🪜 Next steps

  • Do the migration
  • Check how much the screening is actually saving tokens, right now I just assumed it would help

Related PRs

CC: @Kulieshova

@pranavsant
pranavsant requested a review from Kulieshova November 2, 2026 11:54
@vercel

vercel Bot commented Nov 2, 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 18, 2026 3:55am UTC

@pranavsant
pranavsant added this pull request to stack #60 November 2, 2026 11:54
@Kulieshova Kulieshova changed the title Pranav/improve website filter feat: improve website filtering when crawling Nov 6, 2026
Kulieshova and others added 7 commits November 6, 2026 15:23
…/zero-abuse-project into pranav/connectScraperToData
…, instead added model call to classify whether source is relevant
…, this way we will never process it again even if it's irrelevant and not stored in intel items as long as the page hasn't been modified since last process
@Kulieshova
Kulieshova force-pushed the pranav/improveWebsiteFilter branch from 4cc19fa to dd4659a Compare November 7, 2026 00:23
Base automatically changed from pranav/connectScraperToData to main November 7, 2026 00:30

This branch was successfully deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve scraper and crawler

2 participants