{"slug": "ai-appliances-ai-agents-and-agencies-in-yaml", "title": "AI Appliances: AI Agents and Agencies in YAML", "summary": "O'Reilly Media has published 'AI Appliances: Build & Deploy Autonomous AI Agents and Agencies in YAML,' a book by kdeps that teaches developers to create and deploy autonomous AI agents and multi-agent systems using YAML configuration files. The book covers the kdeps framework, including workflow and agent modes, LLM resources, browser automation, and multi-agent agencies, with practical examples and a focus on production-ready deployment.", "body_md": "### AI Appliances: Build & Deploy Autonomous AI Agents and Agencies in YAML\n\n- About This Book\n- How This Book Is Organized\n- Code Conventions\n\n### Chapter 1: Why AI Appliances?\n\n- The Prototype Problem\n- The AI Appliance Model\n- What Makes Production AI Hard\n- Two Modes, One Workflow File\n- Who Is kdeps For?\n- No Lock-In, By Design\n- Built to Last\n- If You Are Coming From Another Framework\n- What You Will Build in This Book\n\n### Chapter 2: Getting Started\n\n- Installing kdeps\n- The Local LLM Comes Built In\n- Creating Your First Project\n- The Workflow Entry Point\n- Adding an LLM Resource\n- Adding a Response Resource\n- Running the Workflow\n- How the Execution Flows\n- Hot Reload for Development\n- What You Just Built\n\n### Chapter 3: Core Concepts\n\n- Resources: The Unit of Work\n- The DAG: Dependency-Ordered Execution\n- The Data Store: get() and set()\n- Workflow Mode vs. Agent Mode\n- Backends: Separating Model from Execution\n- Expressions: The Glue\n- Putting It Together\n\n### Chapter 4: Workflow Mode\n\n- Starting a Workflow\n- Request Lifecycle\n- Declaring Dependencies with\n`requires:`\n\n- Parallel Execution\n- Validation\n- The before: and after: Blocks\n- Designing Effective DAGs\n- A Real-World Example: Document Q&A Pipeline\n- Multiple Routes on One Workflow\n- What Workflow Mode Is Not\n\n### Chapter 5: Agent Mode\n\n- Starting Agent Mode\n- What the LLM Sees\n- Single Workflow vs. Folder Mode\n- Tool Inputs and Outputs\n- A Practical Example: Research Assistant\n- Tool Names Matter\n- Built-In Agent Tools\n- Agent Registries (In-Memory)\n- Approval Tokens\n- REPL Slash Commands\n- Skills\n- Session Persistence\n- Mixing Modes: The Two-Layer Architecture\n- Limitations and Trade-offs\n- Next Steps\n\n### Chapter 6: LLM Resources\n\n- Basic Usage\n- Full Configuration Reference\n- Structured JSON Output\n- System Prompts\n- Multi-Turn Conversations\n- tools: — Function Calling (Resource-Based Tools)\n- componentTools: — Component-Based Tools\n- Timeouts\n- Configuring Backends\n- Environment Variables in Config\n- Sampling Parameters\n- Vision (Multimodal Input)\n- Model Routing\n- Streaming (Ollama)\n- Chain-of-Thought and Few-Shot Selection\n- Provider-Specific Options\n- Choosing the Right Model\n- The Output\n\n### Chapter 7: Data Resources\n\n- SQL Resource\n- HTTP Client Resource\n- Python Resource\n- Exec Resource\n- Combining Data Resources\n- Email Resource\n\n### Chapter 8: Knowledge Resources\n\n- Scraper Resource\n- Search Resources\n- Embedding Resource\n\n### Chapter 9: Browser Automation\n\n- Why a Real Browser\n- Basic Usage\n- Browser Engines\n- Actions\n- Authentication: Logging In\n- Session Persistence\n- Full Example: Extracting a Dynamic Dashboard\n- Headless vs. Headed Mode\n- Performance Considerations\n- When to Use Browser vs. Scraper vs. httpClient\n\n### Chapter 10: API Response and Validation\n\n- The API Response Resource\n- Validations\n- The onError Block\n- Practical: A Complete API with Proper Validation\n\n### Chapter 11: Expressions and Data Flow\n\n- Two Syntaxes\n- The Data Store Functions\n- Standard Library\n- Helper Functions\n- before: and after: Patterns\n- Practical: Data Pipeline with Expressions\n- The input Object Shorthand\n- Inline Resources in before: and after:\n- Jinja2 YAML Preprocessing\n- Common Mistakes\n\n### Chapter 12: Components\n\n- Why Components\n- Registry Components\n- Components as LLM Tools\n- Custom Components\n- Design Principles for Components\n- The Component Registry at kdeps.io\n- Publishing to the Registry\n\n### Chapter 13: Agencies — Multi-Agent Systems\n\n- Why Agencies\n- Directory Structure\n- The Agency Manifest\n- Calling One Agent from Another\n- A Complete Multi-Agent Example\n- Running the Agency\n- Packed Agent Archives\n- Packaging the Entire Agency (.kagency)\n- Independent Deployment\n- Agency Design Principles\n\n### Chapter 14: Workflow Configuration\n\n- Top-Level Structure\n- metadata\n- apiServer\n- agentSettings\n- sqlConnections\n- A Production-Ready workflow.yaml\n- Environment Variable Best Practices\n\n### Chapter 15: Sessions, CORS, and Route Restrictions\n\n- Sessions\n- Persistent Memory\n- CORS\n- Route and Method Restrictions\n- Putting It Together: A Stateful API\n\n### Chapter 16: Advanced Configuration\n\n- Persistent Memory Configuration\n- Rate Limiting\n- Trusted Proxies\n- TLS\n- Authentication\n- Security Headers\n- Body Size and Concurrency Limits\n- Request Body Size Preflight\n- Resource Output Caps\n- The Request Object\n- Health Endpoints\n- Per-Agent Config Profiles\n- Provider-Specific Chat Options\n- Production Security Checklist\n\n### Chapter 17: Docker Deployment\n\n- The Two-Step Build\n- Packaging\n- Building Docker Images\n- Running the Docker Image\n- Pushing to a Registry\n- Environment Configuration Patterns\n- Image Size Optimization\n- CI/CD Integration\n\n### Chapter 18: Kubernetes Deployment\n\n- Generating Manifests\n- What Gets Generated\n- Command Reference\n- Adding Secrets and Config\n- Persistent Storage\n- Exposing the Agent\n- Health Checks\n- NetworkPolicy (Opt-In)\n- Resource Limits\n- Horizontal Pod Autoscaling\n- Complete Production Setup\n- Updating a Deployment\n\n### Chapter 19: Standalone Binary\n\n- Overview\n- How It Works\n- Supported Architectures\n- Typical Workflow\n- Running the Prepackaged Binary\n- Edge Device Deployment\n- Embedding the Model: —include-models\n- Air-Gapped Environments\n- Systemd Service\n- Pinning the Runtime Version\n- Comparing Deployment Targets\n\n### Chapter 20: WebServer Mode\n\n- Why WebServer Mode\n- Basic Configuration\n- Static File Serving\n- Subprocess Proxy Mode\n- The Request Routing Logic\n- Production: Building the Frontend In\n- WebSockets\n- Development Workflow\n- Example: Full-Stack Agent with Dashboard\n\n### Chapter 21: Validate, Debug, and Develop\n\n- kdeps validate\n- kdeps doctor\n- Hot-Reload Development Mode\n- Debugging Resource Execution\n- FAQ and Common Problems\n- Logging and Observability\n- The Management API\n\n### Chapter 22: Iteration — items and loop\n\n- items: — For-Each Iteration\n- loop: — While-Loop Iteration\n- items vs. loop: Choosing the Right Tool\n\n### Chapter 23: Error Handling with onError\n\n- The Default: Fail Loud\n- onError: Syntax\n- The Three Actions\n- The error Object\n- Conditional Error Handling with when:\n- Practical Patterns\n- Error Handling vs. Validation\n\n### Chapter 24: Real-World Examples\n\n- Example 1: Customer Support Bot (Multi-Turn)\n- Example 2: Document Processing Pipeline\n- Example 3: Autonomous Research Agency\n- Example 4: Content Moderation API\n- Example 5: Telegram Bot\n\n### Chapter 25: Bot and File Input Sources\n\n- Three Input Sources\n- Bot Source\n- The botReply: Resource\n- File Input Source\n- Choosing an Input Source\n\n### Appendix A: Troubleshooting\n\n- Resource Did Not Execute\n- get() Returns null\n- Validation Always Fails (or Never Fires)\n- LLM Does Not See Context From a Previous Resource\n- DAG Cycle Error\n- Session Not Persisting Between Requests\n- HTTP Request Returns 500 With No Useful Message\n- Expression Evaluation Error: “undefined: X”\n- Resource Runs But Output Is Empty or Wrong Shape\n- kdeps validate Passes But Runtime Fails\n- Deployment: Docker Image Starts But Agent Returns Errors\n- Getting More Information\n\n### Appendix B: Security\n\n- Secrets Management\n- Prompt Injection\n- Authentication and Authorization\n- Transport Security (TLS)\n- Rate Limiting for Abuse Prevention\n- Input Validation as a Security Boundary\n- SQL Injection\n- Multi-Tenant Isolation\n- Logging and Audit Trails\n- Security Checklist for Production Deployments\n\n### Appendix C: Testing Your Agent\n\n- What You Can Test Deterministically\n- What Requires Human Judgment or Statistical Evaluation\n- Smoke Testing With curl\n- Shell-Based Integration Test Script\n- Testing With\n`--dev`\n\nHot Reload - Testing Validation Rules\n- Testing Session Persistence\n- Testing onError Paths\n- Testing Agent Mode Tool Selection\n- CI/CD Integration\n- What Not to Test\n\n### About the Author\n\n### Resources\n\n### Quick Reference\n\n- Key Commands\n- Resource Types Summary\n- Expression Quick Reference\n- Deployment Comparison", "url": "https://wpnews.pro/news/ai-appliances-ai-agents-and-agencies-in-yaml", "canonical_source": "https://leanpub.com/kdeps", "published_at": "2026-08-04 09:47:42+00:00", "updated_at": "2026-08-04 09:52:48.285136+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "ai-infrastructure"], "entities": ["O'Reilly Media", "kdeps"], "alternates": {"html": "https://wpnews.pro/news/ai-appliances-ai-agents-and-agencies-in-yaml", "markdown": "https://wpnews.pro/news/ai-appliances-ai-agents-and-agencies-in-yaml.md", "text": "https://wpnews.pro/news/ai-appliances-ai-agents-and-agencies-in-yaml.txt", "jsonld": "https://wpnews.pro/news/ai-appliances-ai-agents-and-agencies-in-yaml.jsonld"}}