← All work

Gravton — Crawler, Citations & Social Pipelines

The crawl, attribution and ingestion layer under a GEO visibility platform

Role
AI Engineer
Timeline
Feb 2026 – May 2026
Context
Gravton Labs · Ontario, Canada (remote)

The outcome

  1. Primary engineer on the citation attribution engine: extraction normalised across 5 LLM provider families (OpenAI, Anthropic, Gemini, Perplexity, xAI) plus Google AI Overviews behind one registry, gated on retrieved grounding so ungrounded URLs never score.
  2. Sole author of the Reddit, Quora and YouTube intelligence pipelines: three Django apps behind their own Airflow DAGs (YouTube alone is 17 tasks), with deterministic 5-signal authority scoring and read-only answer-unit contracts downstream.
  3. Built the crawler's discovery, scoring, selection and budgeting layers: sitemap and DOM discovery, an adaptive pass, Apify fallback, canonical dedupe with locale normalisation and robots gating, and typed slot allocation.
  4. Implemented the citation metric set behind the Insights Engine: mass-weighted brand share with the unattributed bucket excluded from the denominator, competition-ranked position, per-model availability, and domain, page and daily-trend tables.
  5. Cut the crawler's browser pool 5–10× (100 contexts and 250 pages down to 20 and 25) after auditing zero-page crawls, and added pool warm-up and specific seed-failure classifications.
  6. Drove the Airflow migration and took the platform to production: containerised the Django, Celery and Airflow stack, moved crawl, enrich and citation stages onto DAGs with idempotent persistence, then hardened the deploy with Gunicorn, a locked-down Traefik, internal services off the host network and request-time nginx upstream DNS.
  7. Ported the crawler and insights services from Encore TypeScript to FastAPI on Railway over Supabase, dispatching heavy stages to Modal serverless. Both platforms run in production.
  8. Closed a cross-brand-set data leak that surfaced out-of-scope competitors in customer-facing citation results.

The challenge

Gravton is an AI-search-visibility platform. It tells a brand how it shows up inside answers from ChatGPT, Perplexity, Claude, Gemini and Google AI Overviews. I built much of the data layer underneath it: the crawler that decides which of a brand's pages are worth fetching, the citation engine that turns the links inside model answers into brand-level metrics, and the Reddit, Quora and YouTube pipelines that bring community signal in. Later I moved that work onto Airflow and took the platform to production.

Both halves are selection problems that look like data problems. A crawler with a page budget spends it in whatever order URLs arrive, so it fills up on blog posts and misses the pricing and comparison pages that AI answers actually draw on. A citation is only useful once it is attributed to a brand, and attribution against a global brand list always matches something, which is worse than matching nothing.

The system

The production system splits a control plane from a work plane. Django owns business state (organisations, domains, brandkits, and one workflow row per run) and starts work through Airflow's REST API; Airflow runs the heavy stages as a chain of DAGs and reports back through a token-checked callback, so clients only ever poll Django. crawl_dag discovers URLs, scores and selects them against typed budgets, hands the selected set to an Apify actor and polls for the dataset, then enriches the pages and writes them to S3. Downstream DAGs build the brandkit and synthetic prompts, and responses_dag fans every prompt, model and generation out to Celery workers over Redis. Stages pass S3 artifact references instead of payloads, which keeps XCom bounded and lets a task on one container pick up output written on another. citation_dag then runs a strictly ordered sequence: extract citations from each answer's retrieved grounding, attribute source by domain ownership only, score support inside a per-row candidate map, weight by source type with log damping for repeated domains, and upsert on (response, page URL) so reruns are idempotent. Failure is explicit at each hop: a DAG failure callback marks the workflow failed in Django, and the Celery fan-out tolerates partial failure only up to a configured threshold. Before Airflow, the same crawler and citation logic ran as FastAPI services on Railway over Supabase, with the citation pipeline dispatched to Modal.

dagRuns APItrigger · pollS3 keyspromptsprompt × modelS3 artifactsupsertauthoritystatus callbackDjango APIworkflow state · RESTcrawl_dagdiscover · score · budgetApify actorfetches selected URLsbrandkit · prompt DAGscompetitors → promptsresponses_dagCelery fan-out · K gensLLM answer modelsgrounded generationscitation_dagextract · attributeSocial DAGsReddit · Quora · YouTubePostgresprompt_citations · runsInsights metricsshare · rank · trend
Gravton — Django control plane, Airflow DAG chain, citation attribution

The hard parts

  1. Candidate starvation and attribution leakage

    Rows reached enrichment with an empty candidate map, so they could never be attributed, and support attribution ran before the map existed, scoring against the global known-brands set. The fix was ordering plus a layered fallback: build the map first, filling it from ambiguous candidates, alias hits, content matches, domain and URL tokens, and finally the run's active competitors, then score support only inside it. Source attribution was narrowed to domain ownership, because snippet, token and content paths had been assigning brands to pages those brands don't own. 'No content' and 'weak candidates' became separate failure modes, since they need different fixes.

  2. Spending a crawl budget on the right pages

    A flat page cap produces a blog-heavy corpus, because blogs are what most sites have most of. Typed budgets fix the distribution: per-type slots for pricing, product, use-case, integrations, docs and comparison pages, drained from a ranked list, with a per-prefix diversity cap so one URL subtree can't consume a category. Ranking before the fetch means quality is decided before spend rather than filtered after it.

  3. Zero-page crawls, diagnosed on paper first

    Crawls were returning zero pages classified as queue_exhausted, and neither the queue nor the pool explained it alone. I wrote a read-only audit of the browser, context and page pools, the priority queue and both retry layers before changing anything. It showed the seed URL was a single point of failure: every attempt drained the pool, so the first fetch paid a cold browser start against a 20-second acquire timeout, and a failed seed ended the crawl with nothing queued. The fixes followed from that: warm the pool after a drain with one retry on a crashed browser, split queue_exhausted into specific seed failures (WAF, empty root, navigation, redirect mismatch), and cut the pool from 100 contexts and 250 pages to 20 and 25.

  4. Three social platforms, one authority contract

    Reddit, Quora and YouTube disagree about what a post is and what engagement means, and three bespoke pipelines would leave nothing downstream able to compare them. Each became a Django app behind its own Airflow DAG, but all three converge on the same two contracts: a deterministic authority score over five weighted signals summing to 1.0, and entity-mention answer units exposed read-only to the insights DAG. The weights differ where the signals do (subscribers carry 0.30 on YouTube and 0.20 on Reddit, where engagement carries more), and every component score stays explainable rather than being a model output nobody can defend.

  5. Auditing a migration instead of trusting it

    When the pipeline moved from the Railway services into Airflow DAGs, the execution shell and basic enrichment came across, but discovery, scoring and typed budgeting largely did not. I audited it against the original as the truth source and scored completeness at 38%, with the five missing layers ranked, which is more useful to hand someone than 'mostly migrated'. The metrics needed the same treatment, because the gaps there were silent: competition ranking with ties had become positional enumeration, and citation share had moved from a 0–100 percentage to a 0–1 fraction.

What I took from it

  • Ordering is a correctness property, not a performance one. Candidate starvation wasn't a scoring bug; the scorer was fine, it just ran before the data it needed existed.
  • Constrain the search space before you score it. Attribution against a global brand set always finds something. Attribution scoped to a candidate map can honestly return nothing, and that is what makes its matches worth anything.
  • Grade a migration against the original, metric by metric. 'It runs' and 'it agrees with what it replaced' are different claims, and only the second is worth making.
  • Write the audit before the fix. Zero-page crawls looked like a capacity problem; reading the pool and queue end to end showed a single fragile seed fetch, which turned a guess-and-retune loop into a few targeted changes.

Stack

Backend
Django REST, FastAPI, Railway, Supabase, PostgreSQL
Pipelines
Airflow, Celery, Redis, Modal, S3 artifacts
Crawling
Playwright, Apify, Browser pooling
Extraction
YAKE, Page-type classification
Sources
Reddit, Quora, YouTube
Infra
Docker Compose, Traefik, Gunicorn, nginx

Timeline

  1. Feb 2026

    Joined Gravton Labs as AI Engineer intern; moved the crawler in and got it running end to end.

  2. Feb – Mar 2026

    Crawler discovery, URL scoring, typed crawl budgeting and the pool audit.

  3. Mar – Apr 2026

    Citation attribution: candidate map, scoped scoring, failure taxonomy, metrics and endpoints.

  4. Apr – May 2026

    Airflow migration and containerisation; metric parity audit; citation and crawl DAGs to production.

  5. May 2026

    YouTube, Reddit and Quora intelligence pipelines; production deploy hardening.

Download resume