DEV Community

Yashraj Awasthi
Yashraj Awasthi

Posted on

How I Built a 45-Agent AI Panel to Brutally Roast Startup Ideas (Architecture Deep Dive)

Every founder knows the feeling: you share a new startup idea with friends, and they all smile and say, "That sounds awesome!"

Six months and thousands of dollars later, you discover nobody actually wants it.

Standard LLMs suffer from the exact same problem: extreme sycophancy. If you ask ChatGPT "Is my startup idea good?", it will write a 10-paragraph essay explaining why your dog-walking drone startup has trillion-dollar potential.

To fix this, I spent the last few months building val8.app - an AI validation engine that simulates a room of 45 realistic, skeptical stakeholders who debate and stress-test an idea before you write a single line of code.

Here is the architectural breakdown of how it works under the hood.

  1. The Challenge: Solving AI Sycophancy Standard prompt engineering fails when you ask a single LLM to evaluate an idea. It tends to smooth out edges, stay agreeable, and generate generic SWOT analyses. To simulate real-world tension, val8 generates personas across 3 distinct clusters:
  2. Investors (15 personas): Obsessed with unit economics, TAM, defensibility, switching friction, and exits.
  3. Subject Matter Experts (15 personas): Ruthlessly poking holes in technical feasibility, compliance, and operational bottlenecks.
  4. Target Users (15 personas): Highly cynical about their actual willingness to pay, inertia, and daily habits.

I have injected intentional "Roaster" and "Ragebait" voices into the prompt grounding. These personas are instructed never to be polite, to call out hidden assumptions, and to simulate the harshest critic you'd ever face in a boardroom or on Reddit.

  1. The Multi-Cluster Elimination Architecture Running 45 simultaneous agents in a single context window is impossible due to token limits, cross-agent context drift, and latency. Instead, we built a tiered debate architecture:
  2. Intra-Cluster Rounds: The 15 personas in each category (Investors, SMEs, Users) conduct internal deliberation and challenge rounds.
  3. Cluster Finalists: The system ranks arguments and narrows down to the top 5 finalists per category (15 total).
  4. Cross-Category Synthesis: The 15 surviving finalists enter a final cross-category debate where an investor can challenge a user's willingness to pay, or an SME can debunk an investor's scalability assumption.
  5. Scored Verdict: Generates consensus scores (1 100) and actionable objection reports.

  6. The Tech Stack

  7. Framework: Next.js 16 (App Router) + React 19

  8. Database & Auth: Supabase (PostgreSQL with RLS) + Prisma ORM

  9. Async Job Queue: BullMQ + Redis (ioredis) to handle long-running simulation workers

  10. Streaming UI: Server-Sent Events (SSE) via EventSource with partial-json parsing for real-time debate rendering

  11. Styling: Tailwind CSS with custom font pairings (Fraunces + Work Sans + IBM Plex Mono)

  12. Payments: Razorpay (credit-based microtransactions for domestic & international users)

  13. Handling Real-Time Multi-Agent Streaming
    One of the hardest parts was giving users visual feedback while 45 personas are generating hundreds of tokens of debate.
    I have decoupled the generation into worker processes (bullmq) that stream chunks through an SSE endpoint:


`typescript
// Client-side EventSource listener for streaming clusters
const sse = new EventSource(`/api/runs/${runId}/stream`);

sse.onmessage = (e) => {
  const payload = JSON.parse(e.data);
  if (payload.type === "chunk") {
  // Incrementally parse partial JSON without waiting for full completion
  const partialData = parse(payload.content);
  updateClusterPreview(payload.cluster, partialData);
 }
};`

This prevents the UI from freezing during intense multi-agent deliberations and gives users a real-time "view into the debate room".
Enter fullscreen mode Exit fullscreen mode

Top comments (0)