Usage Modes - Agent Hustle

Agent Hustle offers three flexible interaction modes to suit different application needs - from simple CLI tools to complex interactive UIs with real-time streaming.

1️⃣ Simple Request/Response

Perfect for CLI tools or simple applications - send a message, get back a complete response:

Basic Usage

JA
simple-mode.js
Loading...

✅ Best For

  • • CLI applications
  • • Batch processing
  • • Simple integrations
  • • One-time queries
  • • Testing and prototyping

📊 Response Structure

JS
response-structure.json
Loading...

2️⃣ Processed Streaming (for interactive UIs)

Receive typed, structured chunks for building interactive experiences:

Streaming Implementation

JA
processed-streaming.js
Loading...

📱 Perfect For

  • • Chat interfaces
  • • Real-time dashboards
  • • Interactive applications
  • • Progressive loading UIs
  • • Tool execution tracking

📦 Chunk Types

text- Streaming text content
tool_call- Tool execution started
tool_result- Tool execution completed
finish- Stream complete

3️⃣ Raw API Streaming (maximum control)

Direct access to the raw API stream format for maximum control and custom processing:

Raw Stream Implementation

JA
raw-streaming.js
Loading...

🔧 Advanced Use Cases

  • • Custom protocol handling
  • • Performance optimization
  • • Custom chunk processing
  • • Protocol debugging
  • • Advanced integrations

🏷️ Prefix Types

'0'- Text chunk
'9'- Tool call
'a'- Tool result
'f'- Message ID
'2'- Path info
'e'/'d'- Completion events

📊 Mode Comparison

FeatureSimpleProcessed StreamingRaw Streaming
ComplexityLowMediumHigh
Real-time UpdatesNoYesYes
Tool TrackingAfter completionReal-timeReal-time
Custom ProcessingLimitedGoodFull control
Best ForCLI, ScriptsChat UIs, DashboardsCustom integrations

🎯 Choosing the Right Mode

🔨 Use Simple Mode When:

  • • Building CLI tools
  • • Processing batches
  • • Simple integrations
  • • You don't need real-time updates
  • • Prototyping quickly

💬 Use Processed Streaming When:

  • • Building chat interfaces
  • • Creating interactive UIs
  • • Showing tool execution progress
  • • Real-time user feedback needed
  • • Progressive content display

⚙️ Use Raw Streaming When:

  • • Custom protocol needed
  • • Performance optimization required
  • • Debugging API interactions
  • • Complex integration patterns
  • • Full control over processing

💡 Pro Tips

  • Start with Simple mode for prototyping, then upgrade as needed
  • Use Processed Streaming for most production UIs
  • Implement error handling for all streaming modes
  • Consider network conditions when choosing streaming vs simple
  • Use tool tracking to show users what's happening behind the scenes