SerpApi India Hackathon 2026 · AI Agents track · Solo entry by Pintu Kumar
An AI research assistant that compares libraries and tools using live documentation, release announcements, and community signals — every decision backed by an inspectable evidence ledger.
Ask "React Query vs SWR" (or "best Node.js ORMs") and get a comparison report built
from data fetched seconds ago via SerpApi — not from stale training knowledge.
- Search is the agent's sensor, not a decorative add-on. SerpApi drives discovery, official-doc lookup, release research, news scanning, gap-filling, and head-to-head analysis.
- Verifiable by design. Reports expose unique-source count, core-evidence count, evidence coverage, the exact links used, generation time, and search-credit cost.
- Useful without a second paid API. The deterministic synthesis mode still ranks options, flags maintenance risk, cites evidence, and exports a reusable Markdown decision brief.
- Production-minded agent loop. Paid searches are globally rate-limited, credits are tracked per request, concurrent users cannot corrupt one another's totals, and SSE heartbeats survive buffering proxies.
- LLM prose cannot rewrite facts. Optional AI synthesis may improve the narrative, while versions, dates, repository metrics, health scores, and sources remain application-owned data.
- Plan — the query is split into entities (
"A vs B","A, B, C"); a single topic like"best Python web frameworks"triggers a live discovery search for the top contenders. The agent announces its research plan as a live reasoning trace. - Research (SerpApi + GitHub) — for each entity, in parallel:
- GitHub stats first (free api.github.com): stars, latest release, last activity — the repo's homepage URL usually is the official docs site, so it's used directly as the docs link (no search credit spent).
- Official documentation search (
engine=google,"<entity> official documentation") — only when the repo has no homepage; candidates are ranked by entity-name match. - Release notes (
site:github.com <entity> releases) - News & announcements (
engine=google,tbm=nws) - All SerpApi calls are throttled to ≥1s apart (free-tier rate limit).
- Reflect — the agent inspects gaps (missing docs link? missing release?) and runs targeted follow-up searches, narrating each decision.
- Head-to-head deep dive — the two most-starred contenders get a dedicated
<A> vs <B> comparison migratesearch for trade-offs and migration notes. - Maintenance health — free GitHub data (release cadence, recency, open issues, archived flag) becomes a 0–100 score with human-readable signals.
- Synthesize — if an OpenAI-compatible LLM key is configured, a structured prompt produces a cited JSON report; otherwise an extractive report is built from live data (composite pick: adoption 50% + health 50%, runner-up analysis, risk warnings).
- Report — entity cards with health badges, comparison table, verdict, live agent reasoning log, collapsible source list, one-click Markdown export, and localStorage history. Progress streams over SSE.
Prerequisites: Node.js 20.19+ (or 22.12+)
# 1. Backend
cd backend
cp .env.example .env # add your SERPAPI_API_KEY (free: https://serpapi.com/users/sign_up)
npm install
npm run dev # http://localhost:4000
# 2. Frontend (new terminal)
cd frontend
npm install
npm run dev # http://localhost:5173 (proxies /api to the backend)Production: npm run build in both folders — the backend serves frontend/dist automatically.
| Variable | Required | Description |
|---|---|---|
SERPAPI_API_KEY |
✅ | SerpApi key for all live searches (free plan: 250 searches/month, no card) |
GITHUB_TOKEN |
– | Read-only token that raises GitHub API limits for reliable demo data |
PORT |
– | Backend port (default 4000) |
LLM_BASE_URL |
– | OpenAI-compatible endpoint (default https://api.openai.com/v1) |
LLM_MODEL |
– | Chat model (default gpt-4o-mini) |
LLM_API_KEY |
– | Enables AI-written summaries/verdicts; without it the app runs in extractive mode |
SerpApi is the discovery and web-evidence backbone of the project. Web claims come from live search results; repository statistics and maintenance signals come directly from GitHub's public API and are labeled as such:
- Google Search API (
engine=google) finds each library's official documentation and release-note pages, using scoped queries likesite:github.com <entity> releases. - Google News vertical (
tbm=nws) surfaces the latest launch/update announcements. - Snippets, titles, links, and result dates from
organic_results/news_resultsfeed the report directly; each source is rendered with a clickable link and a kind badge (Docs / Release / News / Repo / Page). - The official
serpapinpm package is used for all calls; 1 search = 1 credit.
Credit budget: 2 credits per entity (releases + news), plus 1 for the head-to-head search. Docs lookup, gap-filling, or discovery can add more, so a 2-way comparison typically costs 5–7 credits. The free 250/month plan covers roughly 35–50 comparisons; 1,000 bonus credits cover roughly 140–200, depending on evidence gaps.
GET /api/health—{ ok, serpApiConfigured, llmConfigured, time }POST /api/research— body{ "query": "React Query vs SWR" }; streamstext/event-streamprogress events, ending with areportevent containing the JSON report.
backend/
src/index.ts Express server + SSE endpoint
src/agent.ts Agent loop: plan → research → reflect → head-to-head → health → synthesize
src/parse.ts Query → entity parsing (+ live discovery mode)
src/research.ts Per-entity SerpApi pipeline (docs, releases, news, GitHub)
src/serpapi.ts Throttled SerpApi client (≥1s between calls, credit counter)
src/github.ts Free GitHub API lookups (no SerpApi credit)
src/health.ts Maintenance-health scoring from GitHub data (0–100)
src/synthesize.ts Optional OpenAI-compatible LLM synthesis
src/extractive.ts No-LLM fallback report builder (composite scoring, risk warnings)
frontend/
src/App.tsx Main view: form → progress → report → history
src/hooks/useResearch.ts SSE client state machine
src/components/ QueryForm, ProgressSteps, EntityCard, ComparisonTable, SourcesList
src/utils/ Markdown export, localStorage history
As required by the hackathon rules: this project was built with Muse, Meta's AI assistant (agentic coding help for architecture, implementation, and documentation). SerpApi provides web evidence, GitHub's public API provides repository signals, and an optional OpenAI-compatible LLM may be used for summarization. An extractive fallback works when no LLM key is configured.
- (0:00–0:20) Hook: "LLMs hallucinate library comparisons — this agent reads live docs."
- (0:20–1:00) Type "React Query vs SWR", show the live reasoning trace as the agent plans, reflects, and deep-dives.
- (1:00–2:00) Walk the report: evidence-quality strip, entity cards with explainable maintenance scores, comparison table, and verdict with runner-up analysis.
- (2:00–2:30) Open the evidence ledger and a primary source; export the decision as Markdown.
- (2:30–3:00) History re-open + "how SerpApi is used" + credits used counter.
End on one sentence: “LiveDocs turns search results into an auditable technical decision, not just another AI answer.”