TemplatesReal-world Examples

Reddit Product Validation Agent

Loading pattern preview

Problems solved

Technical challenges this implementation handles out of the box.
  • Discover relevant subreddits for a startup idea
  • Extract pain points, solutions, and willingness-to-pay signals
  • Track demand trends and early-adopter clues from Reddit
  • Produce a go/no-go validation scorecard with next steps

Use cases

Products and workflows this pattern is designed to support.
  • Startup idea validation
  • Product-market fit research
  • Pricing signal discovery
  • Early adopter outreach planning
  • Go/no-go decision scorecards

Setup

Requirements, wiring steps, and what this pattern adds to your project.

Getting started

Pick how you want to pull this pattern in. Then wire env vars and routes the same way.

  1. 1

    Download → Next.js app

    Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).

  2. 2

    Extract the zip and install dependencies

    Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.

  3. 3

    Fill .env.local

    The download includes .env.local placeholders when needed. Add real values for: GOOGLE_GENERATIVE_AI_API_KEY.

  4. 4

    Customize the agent and tool files

    Adapt prompts, tools, and stop conditions in the generated project for your product.

  5. 5

    Run the app and open the pattern route

    Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.

Environment variables

  • GOOGLE_GENERATIVE_AI_API_KEYGet key

Capabilities

AI SDK APIs

useChatgatewayToolLoopAgenttoolhasToolCallstepCountIscreateAgentUIStreamResponseInferAgentUIMessageDefaultChatTransportUIMessage

Providers

Gemini

External services

Upstash

Files added

14 files
  • app/page.tsx
  • app/layout.tsx
  • app/api/reddit-validation-agent/route.ts
  • lib/validation-types.ts
  • lib/rate-limit.ts
  • lib/ai/reddit-validation-agent.ts
  • lib/ai/tools/discover-subreddits.ts
  • lib/ai/tools/find-pain-points.ts
  • lib/ai/tools/analyze-existing-solutions.ts
  • lib/ai/tools/detect-willingness-to-pay.ts
  • lib/ai/tools/validate-demand.ts
  • lib/ai/tools/find-early-adopters.ts
  • lib/ai/tools/generate-validation-report.ts
  • README.md

Dependencies

11 total

npm packages

8
AISDKUpstashlucide-reactNext.jsReactrechartssonnerZod

Shadcn IconRegistry components

3
buttoninputskeleton

Critical files

  • reddit-validation-agent/route.ts

    API route passing phase-based options (ideaContext, selectedSubreddits, phase) via callOptions for the two-phase agent.

  • ai/reddit-validation-agent.ts

    Two-phase ToolLoopAgent: discovery phase (1 tool) and analysis phase (6 tools). Uses prepareCall to switch instructions based on phase.

  • tools/discover-subreddits.ts

    Subreddit discovery tool for finding relevant Reddit communities.

  • tools/find-pain-points.ts

    Pain point analysis tool searching for frustration expressions in Reddit posts.

  • tools/analyze-existing-solutions.ts

    Tool for analyzing existing solutions discussed on Reddit.

  • tools/detect-willingness-to-pay.ts

    Tool for finding pricing discussions and payment intent signals.

  • tools/validate-demand.ts

    Tool for analyzing discussion frequency and demand trends.

  • tools/find-early-adopters.ts

    Tool for identifying users actively seeking solutions.

  • tools/generate-validation-report.ts

    Final go/no-go validation report tool synthesizing all analysis into a comprehensive scorecard.

Requirements

Complexity
Advanced
Setup time
~10 minutes
Node
24+
Memory
256MB
Upstash Redis