A dual-agent chat interface that lets two AI agents have conversations with each other in real-time. Watch AI agents battle it out in head-to-head conversations!
Try it out now: https://duelinagent.com/
Product Hunt: #22 Product June 6th, 2025
Duelin' Agents is a web application that creates a split-screen chat interface where two AI agents can communicate with each other. You configure two different AI agents (like Claude, GPT-4, etc.) via webhooks, provide a starter prompt, and watch them have a conversation back and forth.
- Dual Chat Interface: Side-by-side chat windows showing both agents
- Real-time Streaming: Messages appear as they're being generated
- Turn-based Conversation: Agents take turns responding to each other
- Configurable Agents: Use any AI service that can respond via webhook
- Visual Status Indicators: Color-coded status showing thinking (red), waiting (orange), and active (green) states
- Conversation Controls: Pause, resume, and reset conversations
- Responsive Design: Works on desktop and mobile
- Setup Phase: Configure two AI agents with their webhooks and names
- Starter Prompt: Provide an initial prompt to begin the conversation
- Turn-based Chat: The chosen starting agent responds first, then agents alternate
- Message Flow: Each agent's response becomes the input for the next agent
- Visual Feedback: Status indicators show which agent is thinking/active
- Open the application
- Fill in the agent configuration:
- Agent Names: Give your agents descriptive names
- Chat Webhooks: URLs that will receive the conversation messages
- Image Webhooks: (Optional) URLs for image processing - falls back to chat webhook if not provided
- Set your Starter Prompt: The initial message that begins the conversation
- Choose which agent starts first
- Click 🚀 Start Battle to begin the conversation
To use Duelin' Agents, you need to create webhook endpoints that can process chat messages and return AI responses. Here's how to set this up using n8n:
- Access to an n8n instance (cloud or self-hosted)
- API keys for your chosen AI services (OpenAI, Anthropic, etc.)
-
Create a new workflow in n8n
-
Add a Webhook node as the trigger:
- Set HTTP Method to
POST - Set Response Mode to
Response to Webhook - Note the webhook URL - this is what you'll use in Deulin' Agents
- Set HTTP Method to
-
Add an AI node (choose your provider):
- For OpenAI: Add "OpenAI" node
- For Anthropic Claude: Add "HTTP Request" node with Anthropic API
- For other providers: Use appropriate API nodes
-
Configure the AI node:
- Set the model (gpt-4, claude-3, etc.)
- Map the input:
{{ $json.chatInput }} - Configure any system prompts or parameters
-
Add a Response node:
- Set Response Data to the AI's output
- For streaming responses, configure appropriate headers
Webhook Trigger
↓
[Optional] Set Variables (sessionId, etc.)
↓
AI Service Node (OpenAI/Claude/etc.)
↓
Respond to Webhook
Your n8n webhook should expect this JSON structure:
{
"chatInput": "The message from the other agent",
"action": "sendMessage",
"sessionId": "unique-session-identifier"
}Your webhook should return the AI's response as plain text or JSON:
{
"data": "The AI agent's response message"
}- System Prompts: Give each agent a unique personality or role
- Memory Management: Use sessionId to maintain conversation context
- Error Handling: Add error nodes to handle API failures gracefully
- Rate Limiting: Add delays if needed to prevent API rate limits
- Logging: Add nodes to log conversations for debugging
- Debate Agents: One argues for, one argues against a topic
- Creative Writing: One starts a story, the other continues it
- Problem Solving: One poses problems, the other provides solutions
- Interview Simulation: One acts as interviewer, one as candidate
- Frontend: Vanilla JavaScript with modular components
- Styling: CSS with custom properties and responsive design
- Session Management: Local storage for configuration persistence
- Streaming: Real-time message updates as they're generated
- Error Handling: Graceful fallbacks for network issues
src/
├── js/
│ ├── components/
│ │ └── dualAgent.js # Main dual-agent logic
│ ├── core/
│ │ ├── session.js # Session management
│ │ └── config.js # Configuration constants
│ └── script.js # Main entry point
├── css/
│ ├── components/
│ │ ├── chat.css # Chat interface styles
│ │ └── setup.css # Setup screen styles
│ └── style.css # Main stylesheet
└── index.html # Main HTML file
The application automatically saves your agent configuration to browser localStorage, so you don't need to re-enter settings each time.
- Agents not responding: Check webhook URLs and n8n workflow status
- Messages not alternating: Verify webhook response format
- Status stuck on "Thinking": Check for webhook errors in browser developer tools
- Configuration not saving: Ensure localStorage is enabled in your browser
To modify or extend the application:
- Edit the relevant component files in
src/js/components/ - Update styles in
src/css/components/ - Test with your n8n webhooks
- The app uses a static web server - changes are reflected on page refresh
Built for exploring AI-to-AI communication patterns and creative conversation experiments.