DEV Community

mahmoud abd allah mohamed
mahmoud abd allah mohamed

Posted on

I built a free multi-agent AI debate system — no API keys, no cost, runs in OpenCode

I got tired of asking one AI model and trusting it blindly.

So I built SYNAPSE — a workflow where 3 AI agents debate your problem independently, then I only decide where they disagree. The whole thing costs $0 to run.

Here's how it works and how you can use it today.


The Problem With Single-Model AI

When you ask Claude or GPT a question, you get one perspective. That model has blind spots. You don't know what it missed.

The research backs this up — multi-agent debate systems consistently outperform single models on complex problems (Google DeepMind published on this in 2023).

But setting up multi-agent workflows is painful. API keys, orchestration code, rate limits, costs...


The Solution: A Workflow, Not a Program

SYNAPSE isn't a CLI or an app. It's a workflow pattern that runs entirely inside OpenCode using its free built-in subagents.

The workflow:

1. Write your problem to problem.md
2. 3 agents debate it independently:
   - @explore  → code-level analysis
   - @general  → architecture & design
   - @research → best practices & alternatives
3. Main agent reads all 3 opinions → writes consensus.md
4. You see: what they agreed on + where they disagreed
5. You decide the conflicts (takes 30 seconds)
6. Execute
Enter fullscreen mode Exit fullscreen mode

No API keys. No TypeScript code to maintain. No costs.


Real Example: Mobile Auth Bug

Here's a session I ran on a real bug:

Problem: JWT auth works on web but fails for mobile users with 401 errors — even with fresh tokens.

What each agent found:

  • @explore → JWT verify() has no clockTolerance + Redis TTL has no buffer
  • @general → Clock skew is the root cause, fix it at the middleware level
  • @researchclockTolerance: 300 is the standard fix + send server timestamp for mobile

Consensus (91%):

  • ✅ All 3 agreed: add clockTolerance: 300 to JWT verify
  • ✅ All 3 agreed: add notBefore: '-30s' to token signing
  • ⚠️ Conflict: fix refresh endpoint now or later?

My decision: Later — mobile release in 3 days, minimum risk.

Result: 3 files changed, mobile auth fixed, web auth unchanged.

The key thing: @explore caught the Redis TTL issue that wasn't even in the original problem description. One model would have missed it.


The File Structure

synapse/
├── AGENTS.md          ← the agent reads this, you don't have to
├── prompts/
│   ├── explore.md     ← tuned for code analysis
│   ├── general.md     ← tuned for architecture
│   └── research.md    ← tuned for best practices
└── demo/              ← complete example session
Enter fullscreen mode Exit fullscreen mode

The main agent (Big Pickle in OpenCode) reads AGENTS.md and knows exactly what to do. You just describe your problem.


How to Use It

# 1. Install OpenCode (free)
npm install -g opencode-ai

# 2. Clone/download SYNAPSE
cd synapse

# 3. Open OpenCode
opencode

# 4. Tell the agent:
Read AGENTS.md and run a SYNAPSE session on: [YOUR PROBLEM]
Enter fullscreen mode Exit fullscreen mode

That's it.


What I Learned

Multi-agent debate works — not because the models are smarter together, but because they catch each other's blind spots before the answer reaches you.

The workflow pattern > the code — I started building a TypeScript CLI with API adapters. Then I realized: the value is in the prompts and the workflow convention, not the code. Deleted the code, kept the markdown files.

Human-in-the-loop is the key feature — the system doesn't auto-execute contested decisions. You decide conflicts. That 30-second decision step is what pushes accuracy from 78% to 94%.


Get the Pack

I packaged the full workflow (AGENTS.md + prompts + complete demo) and put it on Gumroad:

👉 SYNAPSE on Gumroad — $15

Or if you want to build your own version, everything in this post is enough to get started.


Building BIDKIN — a product built on multi-agent workflows.
Follow for more on AI-native development patterns.

Top comments (0)