Skip to content

About

Scrapingdog-powered B2B procurement. Live supplier evidence, exact pack quantities and reviewable purchasing plans. Built by Sarvesh Sehra.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SourcePilot — turn a parts list into a purchasing plan

Open the live SourcePilot app   Explore the public SourcePilot sample

Scrapingdog-powered B2B procurement. Source-linked offers. Exact purchasing quantities.

SourcePilot checks Scrapingdog Build License

Try the sample · Scrapingdog integration · Architecture · Run locally

Live research requires sign-in. The public sample uses labelled offline data and spends no live credits.

The buying decision starts after the search

A robotics lab needs development boards, sensors and workshop supplies. The buyer has a budget, mandatory specifications and several suppliers to compare. Prices arrive in different pack sizes. Shipping and GST details may be missing. The purchase still needs someone to explain what to buy, how much to buy, and which information needs confirmation.

SourcePilot turns that work into a reviewable workflow:

Parts list → live supplier research → compatibility checks → purchasing plans → buyer review.

Source-linked offers, exact order quantities and buyer-reviewed decisions

Actual SourcePilot purchasing workspace

Signed-in DHT22 evaluation captured on 30 November 2026. These are historical observations, not current quotations. The current build additionally keeps unconfirmed shipping out of known totals; the validation guide records subsequent fixes.

Built for the details that change a B2B order

The purchasing problem What SourcePilot does
A listing prices a spool, while the buyer asks for grams Converts explicit pack contents into the requirement's unit before solving.
A cheaper ESP32 has 30 pins, while the build requires 38 Rejects the hard mismatch before purchasing optimisation.
Minimum quantities, bulk tiers and supplier limits affect the cart Models integer pack counts, minimum-order rules and supplier combinations with CP-SAT.
Shipping, tax or stock depth cannot be established Keeps uncertainty visible and the plan conditional.
A supplier quote contains arithmetic mistakes Preserves printed figures and checks totals using deterministic money arithmetic.
A buyer changes a supplier decision Saves that decision and regenerates its plans together, with revision checks.

Our first customer hypothesis is small engineering teams, electronics labs and makerspaces buying in India. Broader industries and commercial pricing remain future validation work.

Scrapingdog is the research engine

The backend orchestrates Scrapingdog calls, parses the returned HTML or structured data, and preserves source evidence for the buyer.

Stage Scrapingdog APIs Contribution
Discover /google, Amazon search, Flipkart search Find candidate distributor and marketplace listings.
Resolve /google_goto Resolve wrapped search links before retrieval and deduplication.
Retrieve /scrape, Amazon product, Flipkart product Retrieve pages or structured product information for offer extraction.
Expand /google_shopping, /google_immersive_product, Amazon offers Conditional deeper discovery and merchant comparisons.
Investigate Google Maps search, places and reviews Optional local-distributor discovery and business-information review.
Preserve /screenshot Optional visual evidence of supplier listings.
Control /account Account credit and concurrency checks.

Static retrieval comes first. Dynamic or premium retrieval is conditional. Caching, deduplication, bounded concurrency, credit allowances and failure events keep research observable. Every run does not call every endpoint.

Actual Scrapingdog research activity and endpoint telemetry

Recorded prototype run: 13 offer records, 74 API calls, one failed request. The displayed 176-credit figure is an internal estimate, not an allocated provider invoice.

Integration details and code anchors →

A real quantity example

Saved sourcing evidence contained these solder listings:

Purchasing option Quantity supplied Item cost
10 spools × 50 g at ₹369 each 500 g ₹3,690
1 spool × 500 g 500 g ₹3,473

That is a ₹217 item-cost difference before shipping. Scrapingdog retrieves the listing information; our normaliser establishes what each price buys; the solver compares the purchasing options.

When a wire listing does not establish its sold length or required conductor type, SourcePilot leaves that requirement uncovered. A partial cart is labelled partial. It is not presented as a complete-order saving.

How the system works

SourcePilot system flow

Explore the editable system flow
flowchart TD
    A[Text, BOM or quotation] --> B[Structured extraction and buyer review]
    B --> C[Scrapingdog discovery and retrieval]
    C --> D[Supplier adapters and source evidence]
    D --> E[Quantity normalisation and hard specification gates]
    E --> F[Decimal and integer-paise calculations]
    F --> G[OR-Tools CP-SAT purchasing strategies]
    G --> H[Supplier carts and evidence warnings]
    H --> I[Buyer review, RFQ drafts and exports]
    J[(Supabase Auth and Postgres)] --- B
    J --- H
    H --> K[Recovery scenarios using saved offers]
    classDef main fill:#263D35,color:#F7F8F3,stroke:#5F7063;
    classDef accent fill:#B9FF66,color:#1B2923,stroke:#263D35;
    class A,B,D,E,F,H,I,J,K main;
    class C,G accent;
Loading

Gemini structures input and drafts text. Python computes financial totals. CP-SAT selects purchasing combinations. Optimality applies to the captured offers and modelled constraints, not the whole internet.

Architecture and trust boundaries →

Using SourcePilot

  1. Review a request. Confirm quantities, units, budget and mandatory specifications.
  2. Open Research activity. Inspect endpoint usage, progress, failures and estimated credits.
  3. Inspect an offer. Follow its source evidence and compare it with a rejected variant.
  4. Compare plans. Explore cheapest known cost, supplier consolidation and balanced trade-offs where feasible.
  5. Test a change. Remove an offer or simulate a disruption using saved data, then inspect the revised plan and export.

SourcePilot landing page in the Graphite and citrus identity

Fresh research and saved evidence are different. A new scan spends provider credits and can produce different results. The public /sample route is an explicitly labelled offline benchmark. Signed-in live research requires configured providers.

Engineering evidence

Check Latest local verification
API regressions and integration tests 170 passed
Frontend request-stream tests 5 passed
Frontend ESLint Passed
Production build including TypeScript Passed
Signed-in workflows Research, persisted plans, offer decisions, recalculation and CSV export exercised

GitHub Actions runs the API and frontend checks without production credentials. The badge reports the remote workflow's actual status. Local verification is not a production-readiness certification.

The hosted app also passed 11 deployment smoke checks on 1 December 2026: public pages, configured backend and gateway health, CORS, unauthenticated isolation and cross-site write protection. These read-only checks do not start provider research. Deployment verification →

The live evaluation also exercised four sourcing datasets producing 30 offer records, quotation arithmetic through real Gemini responses, research reconnects and zero-extra-scrape recovery simulations. Offer counts describe records, not unique suppliers. Validation scope →

Run locally

Requirements: Python 3.13, Node.js 24, npm, a Supabase project for signed-in workspaces, and provider credentials for live research.

git clone https://github.com/AEGIS-LABz/sourcepilot.git
cd sourcepilot
Copy-Item .env.example .env

Configure Supabase and provider settings in .env. Create apps/web/.env.local using apps/web/.env.example. Apply the versioned migrations to your own Supabase project and configure authentication redirects. Authentication setup →

Terminal 1 — API

cd apps/api
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
.\.venv\Scripts\python.exe -m uvicorn app.main:app --reload --port 8000

Terminal 2 — web

cd apps/web
npm.cmd ci
npm.cmd run dev

Open http://localhost:3000. Use /sample for the offline benchmark or sign in for a saved workspace. Provider keys belong on the API and must never use a NEXT_PUBLIC_ prefix.

Verification commands

From apps/api:

.\.venv\Scripts\python.exe -m pytest -v

From apps/web:

npm.cmd test
npm.cmd run lint
npm.cmd run build

Tests use isolated local storage and blank provider keys. They do not spend live research credits.

Project map

apps/api/app/
  scrapingdog/      API client, allowances and telemetry
  research/        Discovery and persisted research jobs
  adapters/        Supplier response and page extraction
  matching/        Product identity and hard specifications
  normalisation/   Quantity bases, tax splits and integer-paise money
  optimiser/       CP-SAT plans and infeasibility diagnosis
  quotation/       Deterministic quotation checks
  rescue/          Disruption scenarios and revised allocations
  db/              Persistence, revisions and collaboration
apps/web/src/      Next.js workspace and same-origin gateway
supabase/          Versioned schema, policy and RPC migrations
docs/              Demo, integration and operations guides

Scope and next steps

The current build is a hackathon MVP. Supplier information needs buyer confirmation where evidence is incomplete. Hosted load testing, backup recovery, current multi-account role validation and a real customer pilot remain release work.

The proposed pilot is one electronics buying team and five representative requests, measuring time to a reviewed cart, unresolved fields, buyer acceptance and research credits per request. Workspace subscriptions with a bounded research allowance are a commercial hypothesis, not claimed revenue or traction.

Author and licensing

Maintained by Sarvesh Sehra for the SourcePilot hackathon project and team.

Source available under the SourcePilot Evaluation & Non-Commercial License 1.0. Personal study, educational use, noncommercial evaluation and hackathon judging are permitted with attribution. Commercial use and redistribution require written permission, subject to the platform-forking and contribution exceptions. This custom restricted license is not an OSI-approved open-source license. Third-party components retain their own licenses.

Contributing · Security · Notices · Deployment

About

Scrapingdog-powered B2B procurement. Live supplier evidence, exact pack quantities and reviewable purchasing plans. Built by Sarvesh Sehra.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages