SPB Git

spb/search-box Public

Agentic web research engine — hypotheses, verbatim evidence, contradictions, sourced answers streamed live. Claude Opus 5 + Firecrawl + PostgreSQL.

TypeScript 76.9% CSS 18.7% SQL 2.1% JavaScript 1.8% Shell 0.5%
ZIP
NameLast commitUpdated
apps Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
deploy Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
docs README: screenshots, logo, metric badges; screenshot script 1 h ago
packages Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
scripts README: screenshots, logo, metric badges; screenshot script 1 h ago
.env.example Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
.gitignore Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
CLAUDE.md Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
package.json README: screenshots, logo, metric badges; screenshot script 1 h ago
pnpm-lock.yaml README: screenshots, logo, metric badges; screenshot script 1 h ago
pnpm-workspace.yaml Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
README.md README: screenshots, logo, metric badges; screenshot script 1 h ago
tsconfig.base.json Search-box.ai — agentic web research engine (MVP + production deploy) 1 h ago
README.md
Search-box.ai logo

# Search-box.ai

TypeScript Next.js Claude Firecrawl PostgreSQL Streaming Live

Don't search the web. Search the answer space.

Search-box.ai is a multi-step, agentic web research engine. Given a hard question it autonomously forms hypotheses, decomposes uncertainty, runs purposeful searches, opens sources, extracts verbatim evidence, surfaces contradictions, updates beliefs — and streams a fully sourced answer while you watch every step live.

Built on the Anthropic Claude API (reasoning & orchestration) and Firecrawl (web infrastructure). PostgreSQL holds the durable research state; every UI update corresponds to a real backend event.


# Screenshots

A completed research session — the question blooms into objectives and claims, every node driven by a real backend event:

Live research session: bloom graph, stats bar, timeline and streamed answer
Home page — question composer

Home — ask a question that deserves real research

Mobile view — streamed answer

Mobile-first, one-handed


# Validated on a real research problem

Benchmark question: "Can transformer KV cache be compressed by an order of magnitude without seriously harming model quality?" — one autonomous session, no human steering:

objectives sources fetched verbatim evidence claims contradictions found

The engine assigned differentiated confidence per claim (40% / 85% / 90%), and caught a genuine contradiction: a vendor blog presenting 8× compression as "comparable" quality for a method whose peer-reviewed paper only claims lossless behavior up to 4×.

# How it works

text
question → understand objective → form hypotheses → decompose uncertainty
→ decide next action → use web tools → inspect evidence → update beliefs
→ identify gaps/contradictions → repeat → synthesize evidence-backed answer
  • No fixed pipeline — Claude decides research strategy through tool use; the app enforces safety: hard budgets, zod-validated tool contracts, SSRF guard, prompt-injection defense on all scraped content.
  • Claims & evidence are first-class objects — verbatim quotes tied to falsifiable claims with stances (supports / contradicts / context) and probabilistic confidence.
  • Contradictions are a research success, not an error state.
  • Provenance is never lost — every answer sentence traces mechanically: sentence → [n] marker → citation index → source → evidence → claim.
  • Event-sourced UI — the client replays the persisted event stream (SSE with Last-Event-ID recovery); nothing on screen is a fake progress animation.

# Quick start

bash
pnpm install
cp .env.example .env        # ANTHROPIC_API_KEY, FIRECRAWL_API_KEY, DATABASE_URL
pnpm migrate                # apply PostgreSQL schema
pnpm dev                    # web app on http://localhost:3000

Run a session from the terminal:

bash
pnpm research "Your hard question here"

# Repository structure

text
apps/web            Next.js app (UI + API routes + SSE)
packages/agent      orchestrator loop, prompts, tools, session runner
packages/research   ResearchState service (claims, evidence, sources, contradictions)
packages/firecrawl  Firecrawl v2 adapter (search, scrape) + SSRF guard
packages/anthropic  Anthropic Messages API adapter (streaming)
packages/events     typed research event protocol
packages/db         PostgreSQL schema, migrations, repositories
packages/shared     shared types, zod schemas, budgets, ids
deploy/             ngrok config + start script (node m3u96a)
docs/               architecture, agent loop, research state, event protocol

Full design notes in docs/architecture.md.

# Deployment

Production runs on node m3u96a behind an ngrok tunnel: https://www.search-box.ai — see deploy/.


# Author

Simon-Pierre Boucher 📫 contact@spboucher.ai

author contact

© 2026 Simon-Pierre Boucher. All rights reserved.