Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f38001443 |
85
docs/gradient-bang-analysis.md
Normal file
85
docs/gradient-bang-analysis.md
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# Gradient Bang — Multi-Agent Architecture Analysis
|
||||||
|
|
||||||
|
## Research Source
|
||||||
|
|
||||||
|
- **Repo:** https://github.com/pipecat-ai/gradient-bang
|
||||||
|
- **Stars:** 127 | **Forks:** 24 | **License:** Apache 2.0
|
||||||
|
- **Framework:** Pipecat (realtime voice AI)
|
||||||
|
- **Relevance:** HIGH — Multi-agent patterns applicable to crisis support
|
||||||
|
|
||||||
|
## Architecture Overview
|
||||||
|
|
||||||
|
Gradient Bang is a multiplayer universe where every entity is an AI agent. Players interact via voice with their ship\'s AI. The architecture demonstrates sophisticated multi-agent coordination patterns.
|
||||||
|
|
||||||
|
### Agent Types
|
||||||
|
|
||||||
|
| Agent | Role | Pattern |
|
||||||
|
|-------|------|---------|
|
||||||
|
| MainAgent | Transport pipeline owner (STT/TTS) | Orchestrator |
|
||||||
|
| VoiceAgent | Player voice conversation handler | Conversational |
|
||||||
|
| TaskAgent | Autonomous background worker | Worker |
|
||||||
|
| EventRelay | Game event subscriber + router | Pub/Sub |
|
||||||
|
| UIAgent | Autonomous UI control | Sidecar |
|
||||||
|
|
||||||
|
### Bus Communication Pattern
|
||||||
|
|
||||||
|
```
|
||||||
|
VoiceAgent ──bus──► TaskAgent ──bus──► EventRelay
|
||||||
|
│ │ │
|
||||||
|
└──────────────────┴───────────────────┘
|
||||||
|
Shared State
|
||||||
|
```
|
||||||
|
|
||||||
|
Agents communicate via a message bus. No direct coupling. Events are published and subscribed to asynchronously.
|
||||||
|
|
||||||
|
### Key Patterns
|
||||||
|
|
||||||
|
#### 1. Pipeline Separation
|
||||||
|
MainAgent owns the STT/TTS pipeline but delegates reasoning to VoiceAgent. Separation of transport from intelligence.
|
||||||
|
|
||||||
|
#### 2. Task Spawning
|
||||||
|
TaskAgent runs autonomous tasks in background. VoiceAgent can spawn tasks without blocking the conversation.
|
||||||
|
|
||||||
|
#### 3. Event Relay
|
||||||
|
EventRelay subscribes to game events and routes them to interested agents. Pub/Sub pattern for loose coupling.
|
||||||
|
|
||||||
|
#### 4. Parallel UI
|
||||||
|
UIAgent updates UI independently of conversation flow. Non-blocking visual updates.
|
||||||
|
|
||||||
|
## Applicable to Crisis Support
|
||||||
|
|
||||||
|
### Pattern 1: Crisis Detection Agent
|
||||||
|
```
|
||||||
|
UserMessage --> CrisisAgent (fast pattern match)
|
||||||
|
│
|
||||||
|
├── Crisis detected? --> 988Response (immediate)
|
||||||
|
└── No crisis? --> VoiceAgent (normal flow)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 2: Escalation Relay
|
||||||
|
```
|
||||||
|
CrisisAgent --> EscalationRelay --> HumanNotifier
|
||||||
|
│ │
|
||||||
|
└── Log event └── Telegram alert
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pattern 3: Parallel Resource Loading
|
||||||
|
```
|
||||||
|
CrisisDetected --> Par[
|
||||||
|
Load988Info(),
|
||||||
|
LoadLocalResources(),
|
||||||
|
FormatResponse()
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation Recommendations
|
||||||
|
|
||||||
|
1. **Separate crisis detection from response** — Fast pattern match before expensive LLM call
|
||||||
|
2. **Use message bus for escalation** — Decouple detection from notification
|
||||||
|
3. **Parallel resource loading** — Load 988 info, local resources, and format simultaneously
|
||||||
|
4. **Event sourcing** — Log all crisis detections for audit
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- `docs/gradient-bang-analysis.md` — This document
|
||||||
|
- `agent/crisis_bus.py` — Message bus for crisis events (proposed)
|
||||||
Reference in New Issue
Block a user