paladin-ai 0.4.3

Enterprise AI orchestration framework with multi-agent coordination patterns
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# paladin muster - AI-Powered Battalion Generation

Generate production-ready Battalion configurations from natural language descriptions using LLM intelligence.

## Table of Contents

- [Overview]#overview
- [Quick Start]#quick-start
- [Command Syntax]#command-syntax
- [Generation Workflow]#generation-workflow
- [Configuration Options]#configuration-options
- [Output Formats]#output-formats
- [Best Practices]#best-practices
- [Examples]#examples
- [Troubleshooting]#troubleshooting

## Overview

The `muster` command leverages LLM intelligence to:
- **Translate** natural language descriptions into Battalion configurations
- **Suggest** optimal orchestration patterns (Formation, Phalanx, Campaign, Chain of Command)
- **Generate** complete YAML/JSON configurations with validation
- **Preview** the generated configuration before saving
- **Validate** configuration against Paladin schema

### When to Use Muster

✅ **Use muster when:**
- Creating complex multi-agent workflows from scratch
- Prototyping new orchestration patterns
- Need AI suggestions for optimal agent coordination
- Want validated, production-ready configurations quickly

❌ **Don't use muster when:**
- You have existing configurations (use `paladin run` instead)
- Need precise manual control over every parameter
- Working with sensitive/proprietary orchestration logic

## Quick Start

### Basic Usage

```bash
# Generate a simple sequential workflow
paladin muster "Create a data analysis pipeline: fetch data, clean it, analyze patterns, generate report"

# Generate a parallel processing workflow
paladin muster "Process customer reviews in parallel: sentiment analysis, topic extraction, summary generation"

# Generate with specific pattern
paladin muster --pattern formation "Three-step research workflow"

# Generate and save directly
paladin muster "Code review workflow" --output code_review.yaml --yes
```

## Command Syntax

```bash
paladin muster [OPTIONS] <DESCRIPTION>

Arguments:
  <DESCRIPTION>
      Natural language description of the desired Battalion workflow
      Can be a sentence, paragraph, or detailed specification

Options:
  -p, --pattern <PATTERN>
      Preferred orchestration pattern (formation, phalanx, campaign, chain_of_command)
      If not specified, LLM will suggest the best pattern

  -o, --output <FILE>
      Output file path (YAML or JSON based on extension)
      If not specified, displays configuration without saving

  -f, --format <FORMAT>
      Output format: yaml (default) or json

  -y, --yes
      Auto-confirm and save without preview

  --provider <PROVIDER>
      LLM provider to use for generation (openai, deepseek, anthropic)
      Default: Uses default provider from configuration

  --model <MODEL>
      Specific LLM model to use
      Example: gpt-4, deepseek-chat, claude-3-opus

  --temperature <TEMP>
      Generation temperature (0.0-2.0)
      Lower = more focused, Higher = more creative
      Default: 0.7

  --validate
      Validate the generated configuration against schema
      Enabled by default, use --no-validate to skip

  --interactive
      Interactive mode - refine the generated config through conversation

  -v, --verbose
      Show detailed generation process
```

## Generation Workflow

### 1. Analysis Phase

```bash
paladin muster "Build a content moderation system"
```

```
🧠 Analyzing workflow requirements...

Requirements Analysis:
- Task Type: Sequential processing with decision points
- Agents Required: 3-4 specialized Paladins
- Suggested Pattern: Campaign (graph-based workflow)
- Estimated Complexity: Medium
```

### 2. Configuration Generation

```
⚙️  Generating Battalion configuration...

Generating:
  ✓ Paladin definitions (4 agents)
  ✓ Orchestration pattern (Campaign)
  ✓ Dependencies and data flow
  ✓ Configuration parameters
```

### 3. Validation Phase

```
✅ Validating configuration...

Validation Results:
  ✓ Schema validation passed
  ✓ All Paladin references valid
  ✓ No circular dependencies
  ✓ Resource requirements satisfied
```

### 4. Preview & Confirmation

```yaml
# Generated Battalion Configuration
# Pattern: Campaign
# Paladins: 4
# Estimated Duration: 30-60 seconds

name: content_moderation_system
description: Automated content moderation with classification and review

battalion:
  type: campaign
  graph:
    nodes:
      - id: content_classifier
        paladin: classifier
      - id: toxicity_detector
        paladin: toxicity
      - id: human_review
        paladin: reviewer
        condition: "{{toxicity_detector.score}} > 0.7"
      - id: final_decision
        paladin: decision_maker

    edges:
      - from: content_classifier
        to: toxicity_detector
      - from: toxicity_detector
        to: human_review
      - from: toxicity_detector
        to: final_decision
      - from: human_review
        to: final_decision

paladins:
  classifier:
    system_prompt: "Classify content into categories..."
    model: gpt-4
    temperature: 0.3
  # ... additional paladins

Save configuration? [Y/n]:
```

## Configuration Options

### Orchestration Patterns

#### Formation (Sequential)
```bash
paladin muster --pattern formation "Data processing pipeline"
```
- Best for: Linear workflows, step-by-step processing
- Use when: Output of one step feeds into the next
- Example: Extract → Transform → Load

#### Phalanx (Parallel)
```bash
paladin muster --pattern phalanx "Analyze documents from multiple perspectives"
```
- Best for: Independent parallel tasks
- Use when: Tasks don't depend on each other
- Example: Multiple AI models processing same input

#### Campaign (Graph/DAG)
```bash
paladin muster --pattern campaign "Complex workflow with conditional branches"
```
- Best for: Complex workflows with branching logic
- Use when: Need conditional execution or task dependencies
- Example: Approval workflows, decision trees

#### Chain of Command (Hierarchical)
```bash
paladin muster --pattern chain_of_command "Hierarchical task delegation"
```
- Best for: Manager-worker patterns
- Use when: Need dynamic task distribution
- Example: Project management, ticket routing

### Provider Selection

```bash
# Use specific provider
paladin muster --provider openai "Customer support workflow"

# Use specific model
paladin muster --provider anthropic --model claude-3-opus "Research synthesis"

# High creativity
paladin muster --temperature 1.5 "Creative brainstorming workflow"

# High precision
paladin muster --temperature 0.2 "Code analysis workflow"
```

## Output Formats

### YAML (Default)

```bash
paladin muster "Simple workflow" -o workflow.yaml
```

```yaml
name: simple_workflow
description: Generated by paladin muster

battalion:
  type: formation
  sequence:
    - analyzer
    - processor
    - reporter

paladins:
  analyzer:
    system_prompt: "Analyze input data..."
    model: gpt-4
```

### JSON

```bash
paladin muster "Simple workflow" -o workflow.json -f json
```

```json
{
  "name": "simple_workflow",
  "description": "Generated by paladin muster",
  "battalion": {
    "type": "formation",
    "sequence": ["analyzer", "processor", "reporter"]
  },
  "paladins": {
    "analyzer": {
      "system_prompt": "Analyze input data...",
      "model": "gpt-4"
    }
  }
}
```

## Best Practices

### 1. Write Clear Descriptions

✅ **Good:**
```bash
paladin muster "Create a 3-stage content pipeline:
1. Extract key information from articles
2. Summarize findings into bullet points  
3. Generate social media posts from summaries"
```

❌ **Avoid:**
```bash
paladin muster "do content stuff"
```

### 2. Specify Requirements

```bash
paladin muster "
Research workflow that:
- Searches multiple sources in parallel
- Synthesizes findings sequentially
- Requires 4-5 specialized agents
- Should complete within 2 minutes
"
```

### 3. Iterate with Interactive Mode

```bash
paladin muster --interactive "Customer onboarding workflow"
```

Then refine through conversation:
```
You: Add a validation step after data collection
Assistant: Adding validation paladin between collector and processor...
You: Make the welcome message more friendly
Assistant: Updating welcome_agent system prompt...
```

### 4. Validate Before Production

```bash
# Always validate generated configs
paladin muster "Workflow" -o config.yaml

# Test before deploying
paladin run -c config.yaml --dry-run

# Test with sample input
paladin run -c config.yaml -i "test input"
```

### 5. Use Version Control

```bash
# Save with descriptive names
paladin muster "v2 with retry logic" -o workflow_v2.yaml

# Track changes
git add workflow_v2.yaml
git commit -m "feat: add retry logic to workflow"
```

## Examples

### Example 1: Data Analysis Pipeline

```bash
paladin muster "
Sequential data analysis:
1. Fetch data from API
2. Clean and validate data
3. Perform statistical analysis
4. Generate visualization recommendations
5. Create final report
" -o data_pipeline.yaml
```

### Example 2: Parallel Content Processing

```bash
paladin muster --pattern phalanx "
Process a blog post in parallel:
- Generate SEO keywords
- Create social media summaries
- Extract key quotes
- Suggest related topics
- Analyze sentiment
" -o content_processor.yaml
```

### Example 3: Approval Workflow

```bash
paladin muster --pattern campaign "
Document approval workflow:
1. Initial review checks format and completeness
2. If incomplete, request revisions
3. If complete, route to appropriate reviewer based on category
4. Technical docs go to tech reviewer
5. Business docs go to business reviewer
6. Final approval from manager
" -o approval_workflow.yaml
```

### Example 4: Customer Support Routing

```bash
paladin muster --pattern chain_of_command "
Customer support ticket routing:
- Manager paladin receives all tickets
- Routes technical questions to tech support team
- Routes billing questions to billing team
- Routes general inquiries to customer service
- Escalates complex issues to senior support
" -o support_routing.yaml
```

### Example 5: Research & Synthesis

```bash
paladin muster --interactive "
Research workflow:
1. Parallel search across academic papers, news, and blogs
2. Collect and filter relevant information
3. Synthesize findings into coherent summary
4. Generate citation list
" -o research_workflow.yaml
```

## Troubleshooting

### Common Issues

#### Issue: Generated config is too simple

**Solution:**
```bash
# Provide more detailed description
paladin muster "Detailed workflow with specific steps: ..." --verbose

# Use higher temperature for more creativity
paladin muster "..." --temperature 1.2

# Try interactive mode to refine
paladin muster --interactive "..."
```

#### Issue: Wrong orchestration pattern suggested

**Solution:**
```bash
# Explicitly specify the pattern
paladin muster --pattern campaign "..."

# Provide clearer requirements about dependencies
paladin muster "Workflow where step B depends on step A, and step C depends on step B"
```

#### Issue: Validation fails

**Solution:**
```bash
# Check validation errors
paladin muster "..." --verbose

# Fix common issues:
# - Invalid Paladin names (use lowercase with underscores)
# - Circular dependencies in Campaign graphs
# - Missing required fields

# Generate again with corrections
paladin muster "corrected description" -o fixed.yaml
```

#### Issue: Configuration doesn't match expectations

**Solution:**
```bash
# Use interactive mode to refine
paladin muster --interactive "..."

# Or iterate manually
paladin muster "..." -o v1.yaml
# Edit v1.yaml as needed
paladin run -c v1.yaml  # Test
paladin muster "improved description" -o v2.yaml
```

#### Issue: LLM provider errors

**Solution:**
```bash
# Check API keys
paladin setup-check

# Try different provider
paladin muster --provider deepseek "..."

# Reduce complexity
paladin muster "simplified version of workflow"
```

### Getting Help

```bash
# View all muster options
paladin muster --help

# Check provider status
paladin setup-check

# Enable verbose output for debugging
paladin muster --verbose "..."

# Test generated config
paladin run -c generated.yaml --dry-run
```

## Advanced Usage

### Custom System Prompts

While `muster` generates system prompts, you can provide hints:

```bash
paladin muster "
Code review workflow:
- Use technical, professional tone
- Focus on security and performance
- Provide actionable feedback
"
```

### Resource Requirements

Specify computational constraints:

```bash
paladin muster "
Fast processing workflow:
- Each step should complete in under 5 seconds
- Use lighter models (gpt-3.5-turbo)
- Minimize agent loops
"
```

### Integration with Existing Configs

```bash
# Generate a new component
paladin muster "Add retry logic component" -o retry_component.yaml

# Manually integrate into existing config
# Or use as reference for manual updates
```

## See Also

- [CLI Usage Guide]../CLI_USAGE.md - Overview of all CLI commands
- [Battalion Documentation]../BATTALION.md - Understanding orchestration patterns
- [Paladin Configuration]../QUICKSTART.md - Manual configuration guide
- [Council Command]COUNCIL.md - Quick group discussions
- [Examples Directory]../../examples/cli_configs/ - Sample configurations

## Support

- **Issues**: Report bugs at https://github.com/yourusername/paladin/issues
- **Discussions**: Ask questions in GitHub Discussions
- **Documentation**: Full docs at https://paladin-ai.dev

---

*Generated configurations should be reviewed before production use. Always test with sample inputs first.*