This directory contains example workflows demonstrating KDeps v2 features.
🤖 Chatbot
Basic LLM chatbot with validation and error handling.
- YAML configuration
- HTTP API with CORS
- Preflight validation
- LLM integration with Ollama
Run:
cd chatbot && kdeps run workflow.yaml --devAdvanced HTTP client features with authentication, caching, and retries.
- Multiple authentication methods (Bearer, API Key, Basic, OAuth2)
- Intelligent retry logic with exponential backoff
- Response caching with TTL
- Proxy and TLS configuration
- Custom headers and timeout management
Run:
cd http-advanced && kdeps run workflow.yaml --devShell command execution with timeout and output capture.
- System command execution
- Output parsing and formatting
- Timeout handling
- Cross-platform shell support
Run:
cd shell-exec && kdeps run workflow.yaml --dev🗄️ SQL Advanced
Advanced SQL operations with batch processing and multiple result formats.
- Named database connections
- Batch operations (
paramsBatch) - CSV and JSON result formatting
- Transaction support
- Connection pooling
Features:
- PostgreSQL analytics queries (CSV output)
- MySQL inventory management
- Batch user status updates
- Multi-database transactions
Run:
cd sql-advanced && kdeps run workflow.yaml --devFile upload handling with multipart form-data support.
- Single and multiple file uploads
- File metadata access (count, names, types)
- File content, path, and MIME type access
- Integration with
get()andinfo()functions
Run:
cd file-upload && kdeps run workflow.yaml --dev👁️ Vision
Vision model integration with image analysis.
- Image file upload via multipart form-data
- Vision model integration (moondream, llava)
- Image analysis with natural language queries
- JSON structured responses
Prerequisites: Install vision model: ollama pull moondream:1.8b
Run:
cd vision && kdeps run workflow.yaml --devAI phone IVR using the native telephony: resource (TwiML for Twilio-compatible providers).
- Keypad menu with match results (
result.status,result.interpretation) - Static opening-hours line, speech-question gather
- LLM answers the spoken question as text for provider-side TTS
Prerequisites: ollama pull llama3.2:1b (for the answer route)
Run:
cd telephony-bot && kdeps run workflow.yaml --dev🔧 Tools
LLM tool calling / function calling with automatic tool execution.
- Tool/function definitions in ChatConfig
- Tool parameter schemas (OpenAI Functions format)
- Automatic tool execution when LLM calls tools
- Tool results fed back to LLM for final response
- Multi-turn conversations with tools
- Multiple tools per request
Features:
- ✅ Tool definitions work
- ✅ Automatic tool execution
- ✅ Tool resources (Python, SQL, HTTP, Exec, APIResponse)
- ✅ Tool arguments automatically stored in memory
Run:
cd tools && kdeps run workflow.yaml --devSession management with persistent storage.
- SQLite-backed persistent session storage
- Session TTL configuration
- Session data storage and retrieval
- Preflight checks using session data
Run:
cd session-auth && kdeps run workflow.yaml --dev🌍 Auto-Env
Demonstrates automatic environment variable scoping per component, auto-scaffolded .env templates, and kdeps component update.
TRANSLATOR_OPENAI_API_KEYoverridesOPENAI_API_KEYinsidetranslatoronly- On first run, kdeps auto-creates
.envtemplate with allenv()vars listed blank - On first run, kdeps auto-creates
README.mdfrom component metadata kdeps component updatemerges new vars into an existing.env- Summarizer falls back to extractive summary when no API key is set
Run:
export OPENAI_API_KEY=sk-... # global fallback
export TRANSLATOR_OPENAI_API_KEY=sk-... # translator only (optional)
cd auto-env && kdeps run workflow.yamlA sub-workflow designed to be called exclusively via run.component. Declares sources: [component] so no HTTP server or listener is started.
sources: [component]- no listener started, driven by parent- Reusable text-transformation sub-module
- Access via
run.componentfrom any parent workflow - Demonstrates
component.descriptionfield
Invoke from a parent:
# This workflow has no standalone entry-point.
# Call it from a parent workflow resource:
# run:
# component:
# name: component-input-source
# with:
# text: "hello world"
# style: title
kdeps validate examples/component-input-sourceDemonstrates automatic dependency installation and per-run cleanup via setup and teardown lifecycle hooks in a custom local component.
setup.pythonPackages— installed once viauv pipsetup.osPackages— installed once viaapt-get/apk/brewsetup.commands— run once after packages are readyteardown.commands— run after every invocation
Run:
cd component-setup-teardown && kdeps run workflow.yamlSingle-shot document summarizer using the file input source. Reads content from --file, stdin, or KDEPS_FILE_PATH and returns a structured AI analysis.
sources: [file]— runs once and exits- Input via
--file, stdin pipe, orKDEPS_FILE_PATH input('fileContent')/input('filePath')in resources- Structured JSON output with title, summary, key points
Run:
cd file-processor
echo "The Eiffel Tower was built in 1889 for the World's Fair." | kdeps run workflow.yaml
# or
kdeps run workflow.yaml --file /path/to/document.txtShows the built-in input component — pre-installed, no kdeps component install needed. Collects named input slots and returns structured JSON.
- Uses the built-in
inputcomponent withquery,text, andkeyslots - 14 named slots:
query,prompt,text,data,key,value,a–h - Passes collected inputs to an LLM for Q&A
- Access component output with
output('actionId')
Run:
cd input-component && kdeps run workflow.yaml- Choose an example directory
- Update database connections if needed
- Run:
kdeps run workflow.yaml --dev - Test endpoints with curl or your browser
- Start with Chatbot - Learn basic YAML, HTTP API, and LLM integration
- Advanced SQL - Master database operations, batch processing, and result formatting
- Build Your Own - Combine features from examples
Most examples require databases. See each example's README for setup instructions.
For quick testing, you can use SQLite (no setup required) by changing connection strings to:
connection: "sqlite:///data.db"Use --dev flag for hot reload during development:
kdeps run workflow.yaml --devThis automatically restarts the server when you modify workflow files or resources.