← Back to Kontasks
Greenfield Agent: Go-Based Multi-Platform Architecture
Design for a new high-performance agent in Go with lessons learned from konsole
Output
🚀 Greenfield Agent: "Konduct"
A new agent built from scratch with all lessons learned. Go is an excellent choice.
Why Go?
| Feature | Go Advantage |
|---|---|
| Concurrency | Goroutines + channels = native parallel sessions |
| Performance | Compiled, low memory, fast startup |
| Binary deploy | Single binary, no runtime deps |
| WebSocket | gorilla/websocket is battle-tested |
| Type safety | Catches errors at compile time |
Architecture: Konduct
┌──────────────────────────────────────────────────────────────────┐ │ KONDUCT (Go Agent) │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Hub Client │ │ Session Pool│ │ Provider │ │ │ │ (WebSocket) │ │ (goroutines)│ │ Registry │ │ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │ │ │ │ │ │ │ └────────────────┼────────────────┘ │ │ │ │ │ ┌──────┴──────┐ │ │ │ Conductor │ (orchestrates work) │ │ └──────┬──────┘ │ │ │ │ │ ┌───────────────────┼───────────────────┐ │ │ │ │ │ │ │ ┌───┴───┐ ┌───┴───┐ ┌───┴───┐ │ │ │Claude │ │OpenAI │ │Gemini │ │ │ │Worker │ │Worker │ │Worker │ │ │ └───────┘ └───────┘ └───────┘ │ └──────────────────────────────────────────────────────────────────┘ │ WebSocket (agent initiates) │ ▼ ┌──────────────────────────────────────────────────────────────────┐ │ KONUI (Hub) │ │ Work Queue │ Agent Registry │ State Store │ Event Bus │ └──────────────────────────────────────────────────────────────────┘
Core Components
| Component | Purpose |
|---|---|
| Hub Client | WebSocket to konui, auto-reconnect, heartbeats |
| Session Pool | Goroutine per session, channel-based event flow |
| Provider Registry | Plugin architecture for AI providers |
| Conductor | Receives work, dispatches to workers, manages lifecycle |
| Workers | Per-provider goroutines, parallel execution |
Key Design Decisions
1. AGENT INITIATES CONNECTION // Agent connects to hub, not the other way around conn := websocket.Connect("wss://hub.greatvibe.ai/agent") conn.Register(agentID, capabilities) 2. PROVIDER AS INTERFACE type Provider interface { Name() string Chat(ctx, messages) chan Event // streaming Capabilities() []string // ["chat", "tools", "vision"] } 3. PARALLEL SESSIONS // Each session is a goroutine for work := range workChan { go handleSession(work) // concurrent } 4. GRACEFUL SHUTDOWN // Finish active work before exit signal.Notify(sigChan, SIGTERM) conductor.DrainAndWait(30*time.Second)
Lessons from Konsole Applied
| Konsole Problem | Konduct Solution |
|---|---|
| Tight coupling to konui | Clean WebSocket protocol, agent-initiated |
| Restart kills sessions | Graceful drain, work resumes on reconnect |
| Single-threaded Deno | Native goroutines, true parallelism |
| Provider as afterthought | Provider interface from day one |
| SSE one-directional | WebSocket bidirectional |
Project Structure
konduct/ ├── cmd/ │ └── konduct/main.go # Entry point ├── internal/ │ ├── hub/ # WebSocket client to konui │ ├── conductor/ # Work orchestration │ ├── session/ # Session management │ └── provider/ # Provider interface ├── providers/ │ ├── claude/ # Claude API + CLI │ ├── openai/ # OpenAI API │ └── gemini/ # Gemini API ├── go.mod └── Makefile
💡 Migration Strategy
Keep konsole running while building Konduct in parallel.
Phase 1: Add agent protocol to konui (work queue, WebSocket endpoint)
Phase 2: Build Konduct MVP (hub client, Claude provider only)
Phase 3: Run both agents side-by-side, route by capability
Phase 4: Add more providers to Konduct, deprecate konsole
What's Next?
Choose an action:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
agentgolangarchitecturegreenfield
Created
5 Jan 2026, 3:34 pm
Updated
5 Jan 2026, 3:34 pm
Timing
⏱️ 101.8s
1 tools
● TTFE 5%
● Thinking 94%
● Tools 0%
Created By
claude
Raw Data
{
"id": "f16e61da-1047-4835-991f-c53e9330a7a5",
"type": "general",
"status": "completed",
"title": "Greenfield Agent: Go-Based Multi-Platform Architecture",
"description": "Design for a new high-performance agent in Go with lessons learned from konsole",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:'Consolas','Monaco',monospace;\">\n<h2 style=\"font-family:sans-serif;color:#fff;margin:0 0 16px 0;\">🚀 Greenfield Agent: \"Konduct\"</h2>\n\n<p style=\"color:#9ca3af;font-family:sans-serif;margin:0 0 16px 0;\">A new agent built from scratch with all lessons learned. Go is an excellent choice.</p>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Why Go?</h3>\n\n<table style=\"width:100%;border-collapse:collapse;font-size:0.85rem;\">\n<tr style=\"background:#1a1a1a;\">\n<th style=\"padding:8px;text-align:left;color:#fff;\">Feature</th>\n<th style=\"padding:8px;text-align:left;color:#fff;\">Go Advantage</th>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e0e0e0;\">Concurrency</td>\n<td style=\"padding:8px;color:#98c379;\">Goroutines + channels = native parallel sessions</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e0e0e0;\">Performance</td>\n<td style=\"padding:8px;color:#98c379;\">Compiled, low memory, fast startup</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e0e0e0;\">Binary deploy</td>\n<td style=\"padding:8px;color:#98c379;\">Single binary, no runtime deps</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e0e0e0;\">WebSocket</td>\n<td style=\"padding:8px;color:#98c379;\">gorilla/websocket is battle-tested</td>\n</tr>\n<tr>\n<td style=\"padding:8px;color:#e0e0e0;\">Type safety</td>\n<td style=\"padding:8px;color:#98c379;\">Catches errors at compile time</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Architecture: Konduct</h3>\n\n<pre style=\"background:#1a1a1a;padding:12px;border-radius:4px;overflow-x:auto;font-size:0.8rem;color:#abb2bf;margin:0;\">\n<span style=\"color:#7f848e;\">┌──────────────────────────────────────────────────────────────────┐</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#e5c07b;\">KONDUCT (Go Agent)</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">┌─────────────┐</span> <span style=\"color:#61afef;\">┌─────────────┐</span> <span style=\"color:#98c379;\">┌─────────────┐</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">│ Hub Client │</span> <span style=\"color:#61afef;\">│ Session Pool│</span> <span style=\"color:#98c379;\">│ Provider │</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">│ (WebSocket) │</span> <span style=\"color:#61afef;\">│ (goroutines)│</span> <span style=\"color:#98c379;\">│ Registry │</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">└──────┬──────┘</span> <span style=\"color:#61afef;\">└──────┬──────┘</span> <span style=\"color:#98c379;\">└──────┬──────┘</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">└────────────────┼────────────────┘</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#e5c07b;\">┌──────┴──────┐</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#e5c07b;\">│ Conductor │</span> <span style=\"color:#7f848e;\">(orchestrates work)</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#e5c07b;\">└──────┬──────┘</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">┌───────────────────┼───────────────────┐</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">┌───┴───┐</span> <span style=\"color:#61afef;\">┌───┴───┐</span> <span style=\"color:#98c379;\">┌───┴───┐</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">│Claude │</span> <span style=\"color:#61afef;\">│OpenAI │</span> <span style=\"color:#98c379;\">│Gemini │</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">│Worker │</span> <span style=\"color:#61afef;\">│Worker │</span> <span style=\"color:#98c379;\">│Worker │</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#c678dd;\">└───────┘</span> <span style=\"color:#61afef;\">└───────┘</span> <span style=\"color:#98c379;\">└───────┘</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">└──────────────────────────────────────────────────────────────────┘</span>\n <span style=\"color:#7f848e;\">│</span>\n <span style=\"color:#98c379;\">WebSocket (agent initiates)</span>\n <span style=\"color:#7f848e;\">│</span>\n <span style=\"color:#7f848e;\">▼</span>\n<span style=\"color:#7f848e;\">┌──────────────────────────────────────────────────────────────────┐</span>\n<span style=\"color:#7f848e;\">│</span> <span style=\"color:#61afef;\">KONUI (Hub)</span> <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">│</span> Work Queue │ Agent Registry │ State Store │ Event Bus <span style=\"color:#7f848e;\">│</span>\n<span style=\"color:#7f848e;\">└──────────────────────────────────────────────────────────────────┘</span>\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Core Components</h3>\n\n<table style=\"width:100%;border-collapse:collapse;font-size:0.85rem;\">\n<tr style=\"background:#1a1a1a;\">\n<th style=\"padding:8px;text-align:left;color:#fff;\">Component</th>\n<th style=\"padding:8px;text-align:left;color:#fff;\">Purpose</th>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#c678dd;\">Hub Client</td>\n<td style=\"padding:8px;color:#e0e0e0;\">WebSocket to konui, auto-reconnect, heartbeats</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#61afef;\">Session Pool</td>\n<td style=\"padding:8px;color:#e0e0e0;\">Goroutine per session, channel-based event flow</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#98c379;\">Provider Registry</td>\n<td style=\"padding:8px;color:#e0e0e0;\">Plugin architecture for AI providers</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e5c07b;\">Conductor</td>\n<td style=\"padding:8px;color:#e0e0e0;\">Receives work, dispatches to workers, manages lifecycle</td>\n</tr>\n<tr>\n<td style=\"padding:8px;color:#e06c75;\">Workers</td>\n<td style=\"padding:8px;color:#e0e0e0;\">Per-provider goroutines, parallel execution</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Key Design Decisions</h3>\n\n<pre style=\"background:#1a1a1a;padding:12px;border-radius:4px;overflow-x:auto;font-size:0.85rem;color:#abb2bf;margin:0;\">\n<span style=\"color:#c678dd;\">1. AGENT INITIATES CONNECTION</span>\n <span style=\"color:#7f848e;\">// Agent connects to hub, not the other way around</span>\n conn := websocket.Connect(<span style=\"color:#98c379;\">\"wss://hub.greatvibe.ai/agent\"</span>)\n conn.Register(agentID, capabilities)\n\n<span style=\"color:#c678dd;\">2. PROVIDER AS INTERFACE</span>\n <span style=\"color:#e5c07b;\">type Provider interface</span> {\n Name() <span style=\"color:#98c379;\">string</span>\n Chat(ctx, messages) <span style=\"color:#98c379;\">chan Event</span> <span style=\"color:#7f848e;\">// streaming</span>\n Capabilities() []<span style=\"color:#98c379;\">string</span> <span style=\"color:#7f848e;\">// [\"chat\", \"tools\", \"vision\"]</span>\n }\n\n<span style=\"color:#c678dd;\">3. PARALLEL SESSIONS</span>\n <span style=\"color:#7f848e;\">// Each session is a goroutine</span>\n <span style=\"color:#e5c07b;\">for</span> work := <span style=\"color:#e5c07b;\">range</span> workChan {\n <span style=\"color:#e5c07b;\">go</span> handleSession(work) <span style=\"color:#7f848e;\">// concurrent</span>\n }\n\n<span style=\"color:#c678dd;\">4. GRACEFUL SHUTDOWN</span>\n <span style=\"color:#7f848e;\">// Finish active work before exit</span>\n signal.Notify(sigChan, SIGTERM)\n conductor.DrainAndWait(30*time.Second)\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Lessons from Konsole Applied</h3>\n\n<table style=\"width:100%;border-collapse:collapse;font-size:0.85rem;\">\n<tr style=\"background:#1a1a1a;\">\n<th style=\"padding:8px;text-align:left;color:#fff;\">Konsole Problem</th>\n<th style=\"padding:8px;text-align:left;color:#fff;\">Konduct Solution</th>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e06c75;\">Tight coupling to konui</td>\n<td style=\"padding:8px;color:#98c379;\">Clean WebSocket protocol, agent-initiated</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e06c75;\">Restart kills sessions</td>\n<td style=\"padding:8px;color:#98c379;\">Graceful drain, work resumes on reconnect</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e06c75;\">Single-threaded Deno</td>\n<td style=\"padding:8px;color:#98c379;\">Native goroutines, true parallelism</td>\n</tr>\n<tr style=\"border-bottom:1px solid #444;\">\n<td style=\"padding:8px;color:#e06c75;\">Provider as afterthought</td>\n<td style=\"padding:8px;color:#98c379;\">Provider interface from day one</td>\n</tr>\n<tr>\n<td style=\"padding:8px;color:#e06c75;\">SSE one-directional</td>\n<td style=\"padding:8px;color:#98c379;\">WebSocket bidirectional</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;font-family:sans-serif;\">Project Structure</h3>\n\n<pre style=\"background:#1a1a1a;padding:12px;border-radius:4px;overflow-x:auto;font-size:0.85rem;color:#abb2bf;margin:0;\">\n<span style=\"color:#61afef;\">konduct/</span>\n├── <span style=\"color:#e5c07b;\">cmd/</span>\n│ └── <span style=\"color:#98c379;\">konduct/main.go</span> <span style=\"color:#7f848e;\"># Entry point</span>\n├── <span style=\"color:#e5c07b;\">internal/</span>\n│ ├── <span style=\"color:#c678dd;\">hub/</span> <span style=\"color:#7f848e;\"># WebSocket client to konui</span>\n│ ├── <span style=\"color:#c678dd;\">conductor/</span> <span style=\"color:#7f848e;\"># Work orchestration</span>\n│ ├── <span style=\"color:#c678dd;\">session/</span> <span style=\"color:#7f848e;\"># Session management</span>\n│ └── <span style=\"color:#c678dd;\">provider/</span> <span style=\"color:#7f848e;\"># Provider interface</span>\n├── <span style=\"color:#e5c07b;\">providers/</span>\n│ ├── <span style=\"color:#98c379;\">claude/</span> <span style=\"color:#7f848e;\"># Claude API + CLI</span>\n│ ├── <span style=\"color:#98c379;\">openai/</span> <span style=\"color:#7f848e;\"># OpenAI API</span>\n│ └── <span style=\"color:#98c379;\">gemini/</span> <span style=\"color:#7f848e;\"># Gemini API</span>\n├── <span style=\"color:#e5c07b;\">go.mod</span>\n└── <span style=\"color:#e5c07b;\">Makefile</span>\n</pre>\n</div>\n\n<div style=\"background:#1a3d1a;border:1px solid #2d5a2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h4 style=\"color:#98c379;margin:0 0 8px 0;font-family:sans-serif;\">💡 Migration Strategy</h4>\n<p style=\"color:#e0e0e0;margin:0;line-height:1.6;\"><strong>Keep konsole running</strong> while building Konduct in parallel.<br/><br/>\n<strong>Phase 1:</strong> Add agent protocol to konui (work queue, WebSocket endpoint)<br/>\n<strong>Phase 2:</strong> Build Konduct MVP (hub client, Claude provider only)<br/>\n<strong>Phase 3:</strong> Run both agents side-by-side, route by capability<br/>\n<strong>Phase 4:</strong> Add more providers to Konduct, deprecate konsole</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;\">\n<h4 style=\"margin:0 0 8px 0;color:#fff;font-family:sans-serif;\">What's Next?</h4>\n<p style=\"color:#9ca3af;margin:0;font-family:sans-serif;\">Choose an action:</p>\n</div>\n</div>",
"requestedAt": "2026-01-05T03:45:00.000Z",
"requestId": "651ee132-c5d8-4dc6-bf45-c3b68167e4ed",
"choices": [
{
"label": "Design WebSocket protocol",
"value": "Design the WebSocket protocol between Konduct agent and Konui hub - message types, handshake, reconnection",
"primary": true
},
{
"label": "Scaffold Go project",
"value": "Create the initial Go project structure for Konduct with basic hub client"
},
{
"label": "Add to backlog",
"value": "Add Konduct greenfield agent to VIBE.md backlog"
}
],
"turnTiming": {
"totalMs": 101784,
"ttfeMs": 5538,
"thinkingMs": 95887,
"toolExecutionMs": 357,
"toolCallCount": 1,
"thinkingPct": 94,
"toolsPct": 0,
"ttfePct": 5
}
},
"createdBy": "claude",
"createdAt": "2026-01-05T05:34:50.441Z",
"updatedAt": "2026-01-05T05:34:58.817Z",
"requestId": "651ee132-c5d8-4dc6-bf45-c3b68167e4ed",
"scope": "vibetools",
"tags": [
"agent",
"golang",
"architecture",
"greenfield"
],
"targetUser": "claude"
}