Context
Build a local demo of an AI agent that helps solo founders discover their next product idea. The founder describes their situation in natural language; the agent conducts one-shot market research via web search and delivers an interactive dashboard report.
Requirements Summary
| Aspect | Decision |
|---|---|
| Frontend | React SPA (Vite) |
| Backend | FastAPI (Python) |
| User Input | Natural language prompt |
| Data Sources | Web search (DuckDuckGo, no API key), social signals via search |
| Output | Interactive dashboard with collapsible sections |
| Research Style | One-shot (~30-60s), parallel sub-searches + LLM synthesis |
| LLM | Kimi K3 via Moonshot Anthropic-compatible endpoint |
Architecture
┌─────────────┐ POST /research ┌─────────────┐
│ React SPA │ ─────────────────────► │ FastAPI │
│ (Vite) │ │ Backend │
│ │ ◄── JSON Report ────── │ │
└─────────────┘ └──────┬──────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ DuckDuckGo │ │ DuckDuckGo │ │ DuckDuckGo │
│ Trends │ │ Competitors │ │ Pain Points │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
└──────────────────────┼──────────────────────┘
▼
┌─────────────┐
│ Kimi K3 │
│ Synthesis │
└─────────────┘
← scroll the diagram sideways
Report Structure (Dashboard Sections)
- Executive Summary — Top-level takeaways and recommended focus areas
- Industry Trends — What's growing, declining, or emerging in the space
- Competitor Landscape — Key players, funding stage, positioning
- Existing Products — Products solving related problems, with feature summaries
- Pain Points & Limitations — What users complain about (from social signals)
- Market Gaps & Opportunities — Unserved niches or under-served segments
- Recommended Next Steps — Actionable ideas for the founder to validate
Research Agent Flow
- Query Decomposition — LLM breaks the founder's prompt into 3-5 parallel search queries
- Parallel Search — Each query runs through DuckDuckGo independently
- Result Aggregation — Deduplicate and rank results by relevance
- Synthesis Pass — LLM analyzes aggregated data and produces structured report JSON
- Response — Backend returns structured JSON; frontend renders interactive dashboard
Tech Stack Details
Backend (backend/)
- Framework: FastAPI with uvicorn
- Search:
duckduckgo-searchPython library (free, no API key) - LLM Client:
anthropicSDK withANTHROPIC_BASE_URLoverride to Moonshot - Data: In-memory storage (research sessions keyed by UUID)
- Key Files:
main.py— FastAPI app, CORS, routesagent.py— Research orchestration (decompose → search → synthesize)search.py— DuckDuckGo search wrapper with rate limitingmodels.py— Pydantic models for request/response
Frontend (frontend/)
- Framework: React 18 + Vite
- Styling: Tailwind CSS (or plain CSS for speed)
- Key Components:
PromptInput— Natural language textarea with examplesResearchDashboard— Report layout with collapsible sectionsSectionCard— Reusable card for each report sectionLoadingState— Progress indicator during research
- Key Files:
src/App.jsx— Main layout, routingsrc/components/PromptInput.jsxsrc/components/ResearchDashboard.jsxsrc/api.js— Fetch wrapper for/research
Critical Design Decisions
- DuckDuckGo over paid APIs — Zero API keys needed for demo. Can swap to Serper.dev/Tavily later.
- No database — Research sessions stored in-memory. Simple for demo; add SQLite if history is needed.
- Streaming response — FastAPI streams partial results so the dashboard populates incrementally (better UX for 30-60s wait).
- One-shot vs. multi-turn — Strictly one-shot. No follow-up questions from the agent to keep it fast.
Verification Plan
- Start backend:
cd backend && uvicorn main:app --reload - Start frontend:
cd frontend && npm run dev - Open
http://localhost:5173, enter a prompt like:“I'm a solo developer with $50k budget, interested in B2B SaaS for the construction industry. I have React and Python skills.”
- Verify dashboard renders with all 7 sections populated.
- Verify research completes in under 60 seconds.
Open Questions
- Should research sessions be persisted to disk (SQLite) so reports survive server restarts?
- Should the dashboard allow exporting to PDF/Markdown?
- Should the agent suggest adjacent/nearby markets if the primary market looks saturated?