@@ -101,6 +101,8 @@ mkdir url-to-social && cd url-to-social
101101```
102102
103103** 2. Create an ` Agentfile ` :**
104+
105+ * Option A: Dockerfile format (traditional)*
104106``` dockerfile
105107FROM yeahdongcn/agentman-base:latest
106108MODEL anthropic/claude-3-sonnet
@@ -126,6 +128,33 @@ SEQUENCE url_analyzer social_writer
126128CMD ["python" , "agent.py" ]
127129```
128130
131+ * Option B: YAML format (recommended for complex workflows)*
132+ ``` yaml
133+ # Agentfile.yml
134+ apiVersion : v1
135+ kind : Agent
136+ base :
137+ model : anthropic/claude-3-sonnet
138+ mcp_servers :
139+ - name : fetch
140+ command : uvx
141+ args :
142+ - mcp-server-fetch
143+ transport : stdio
144+ agents :
145+ - name : url_analyzer
146+ instruction : Given a URL, provide a comprehensive summary of the content
147+ servers :
148+ - fetch
149+ - name : social_writer
150+ instruction : Transform any text into a compelling 280-character social media post
151+ chains :
152+ - name : content_pipeline
153+ sequence :
154+ - url_analyzer
155+ - social_writer
156+ ` ` `
157+
129158**3. Build and run:**
130159` ` ` bash
131160agentman run --from-agentfile -t url-to-social .
@@ -267,6 +296,47 @@ EXPOSE 8080 # Expose ports
267296CMD ["python" , "agent.py" ] # Container startup command
268297```
269298
299+ ### 📄 File Format Support
300+
301+ Agentman supports two file formats for defining your agent configurations:
302+
303+ #### ** Dockerfile-style Agentfile (Default)**
304+ The traditional Docker-like syntax using an ` Agentfile ` without extension:
305+
306+ ``` dockerfile
307+ FROM yeahdongcn/agentman-base:latest
308+ MODEL anthropic/claude-3-sonnet
309+ FRAMEWORK fast-agent
310+
311+ AGENT assistant
312+ INSTRUCTION You are a helpful AI assistant
313+ ```
314+
315+ #### ** YAML Agentfile**
316+ Modern declarative YAML format using ` Agentfile.yml ` or ` Agentfile.yaml ` :
317+
318+ ``` yaml
319+ apiVersion : v1
320+ kind : Agent
321+ base :
322+ model : anthropic/claude-3-sonnet
323+ framework : fast-agent
324+ agents :
325+ - name : assistant
326+ instruction : You are a helpful AI assistant
327+ ` ` `
328+
329+ **Key advantages of YAML format:**
330+ - **🎯 Better structure** for complex multi-agent configurations
331+ - **📝 Native support** for lists, nested objects, and comments
332+ - **🔍 IDE support** with syntax highlighting and validation
333+ - **📊 Clear hierarchy** for routers, chains, and orchestrators
334+
335+ **Usage:**
336+ - **Build**: ` agentman build .` (auto-detects format)
337+ - **Run**: `agentman run --from-agentfile .` (works with both formats)
338+ - **Convert**: Agentman can automatically convert between formats
339+
270340# ## Framework Configuration
271341
272342Choose between supported AI agent frameworks :
@@ -290,6 +360,7 @@ FRAMEWORK agno # Alternative: Agno framework
290360
291361Define external MCP servers that provide tools and capabilities :
292362
363+ **Dockerfile format:**
293364` ` ` dockerfile
294365MCP_SERVER filesystem
295366COMMAND uvx
@@ -298,10 +369,23 @@ TRANSPORT stdio
298369ENV PATH_PREFIX /app/data
299370` ` `
300371
372+ **YAML format:**
373+ ` ` ` yaml
374+ mcp_servers:
375+ - name: filesystem
376+ command: uvx
377+ args:
378+ - mcp-server-filesystem
379+ transport: stdio
380+ env:
381+ PATH_PREFIX: /app/data
382+ ` ` `
383+
301384# ## Agent Definitions
302385
303386Create individual agents with specific roles and capabilities :
304387
388+ **Dockerfile format:**
305389` ` ` dockerfile
306390AGENT assistant
307391INSTRUCTION You are a helpful AI assistant specialized in data analysis
@@ -311,23 +395,64 @@ USE_HISTORY true
311395HUMAN_INPUT false
312396` ` `
313397
398+ **YAML format:**
399+ ` ` ` yaml
400+ agents:
401+ - name: assistant
402+ instruction: You are a helpful AI assistant specialized in data analysis
403+ servers:
404+ - filesystem
405+ - brave
406+ model: anthropic/claude-3-sonnet
407+ use_history: true
408+ human_input: false
409+ ` ` `
410+
314411# ## Workflow Orchestration
315412
316413**Chains** (Sequential processing):
414+
415+ *Dockerfile format:*
317416` ` ` dockerfile
318417CHAIN data_pipeline
319418SEQUENCE data_loader data_processor data_exporter
320419CUMULATIVE true
321420` ` `
322421
422+ *YAML format:*
423+ ` ` ` yaml
424+ chains:
425+ - name: data_pipeline
426+ sequence:
427+ - data_loader
428+ - data_processor
429+ - data_exporter
430+ cumulative: true
431+ ` ` `
432+
323433**Routers** (Conditional routing):
434+
435+ *Dockerfile format:*
324436` ` ` dockerfile
325437ROUTER query_router
326438AGENTS sql_agent api_agent file_agent
327439INSTRUCTION Route queries based on data source type
328440` ` `
329441
442+ *YAML format:*
443+ ` ` ` yaml
444+ routers:
445+ - name: query_router
446+ agents:
447+ - sql_agent
448+ - api_agent
449+ - file_agent
450+ instruction: Route queries based on data source type
451+ ` ` `
452+
330453**Orchestrators** (Complex coordination):
454+
455+ *Dockerfile format:*
331456` ` ` dockerfile
332457ORCHESTRATOR project_manager
333458AGENTS developer tester deployer
@@ -336,10 +461,24 @@ PLAN_ITERATIONS 5
336461HUMAN_INPUT true
337462` ` `
338463
464+ *YAML format:*
465+ ` ` ` yaml
466+ orchestrators:
467+ - name: project_manager
468+ agents:
469+ - developer
470+ - tester
471+ - deployer
472+ plan_type: iterative
473+ plan_iterations: 5
474+ human_input: true
475+ ` ` `
476+
339477# ## Secrets Management
340478
341479Secure handling of API keys and sensitive configuration :
342480
481+ **Dockerfile format:**
343482` ` ` dockerfile
344483# Environment variable references
345484SECRET OPENAI_API_KEY
@@ -355,6 +494,23 @@ BASE_URL https://api.example.com
355494TIMEOUT 30
356495` ` `
357496
497+ **YAML format:**
498+ ` ` ` yaml
499+ secrets:
500+ - name: OPENAI_API_KEY
501+ values: {} # Environment variable reference
502+ - name: ANTHROPIC_API_KEY
503+ values: {}
504+ - name: DATABASE_URL
505+ values:
506+ DATABASE_URL: postgresql://localhost:5432/mydb
507+ - name: CUSTOM_API
508+ values:
509+ API_KEY: your_key_here
510+ BASE_URL: https://api.example.com
511+ TIMEOUT: 30
512+ ` ` `
513+
358514# ## Default Prompt Support
359515
360516Agentman automatically detects and integrates `prompt.txt` files, providing zero-configuration default prompts for your agents.
@@ -426,21 +582,36 @@ This ensures your agent automatically executes the default prompt when the conta
426582
427583## 🎯 Example Projects
428584
585+ All example projects in the ` /examples ` directory include both Dockerfile-style ` Agentfile ` and YAML format ` Agentfile.yml ` for comparison and learning. You can use either format to build and run the examples.
586+
429587### 1. GitHub Profile Manager (with Default Prompt)
430588
431589A comprehensive GitHub profile management agent that automatically loads a default prompt.
432590
433591** Project Structure:**
434592```
435593github-profile-manager/
436- ├── Agentfile
594+ ├── Agentfile # Dockerfile format
595+ ├── Agentfile.yml # YAML format (same functionality)
437596├── prompt.txt # Default prompt automatically loaded
438597└── agent/ # Generated files
439598 ├── agent.py
440599 ├── prompt.txt # Copied during build
441600 └── ...
442601```
443602
603+ ** Build with either format:**
604+ ``` bash
605+ # Using Dockerfile format
606+ agentman build -f Agentfile .
607+
608+ # Using YAML format
609+ agentman build -f Agentfile.yml .
610+
611+ # Auto-detection (picks first available)
612+ agentman build .
613+ ```
614+
444615** prompt.txt:**
445616``` text
446617I am a GitHub user with the username "yeahdongcn" and I need help updating my GitHub profile information.
0 commit comments