Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

KDeps v2 Examples

This directory contains example workflows demonstrating KDeps v2 features.

Examples

🤖 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 --dev

Advanced 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 --dev

Shell 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 --dev

File 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() and info() 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 --dev

AI 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 --dev

Session 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

Demonstrates automatic environment variable scoping per component, auto-scaffolded .env templates, and kdeps component update.

  • TRANSLATOR_OPENAI_API_KEY overrides OPENAI_API_KEY inside translator only
  • On first run, kdeps auto-creates .env template with all env() vars listed blank
  • On first run, kdeps auto-creates README.md from component metadata
  • kdeps component update merges 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.yaml

A 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.component from any parent workflow
  • Demonstrates component.description field

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-source

Demonstrates automatic dependency installation and per-run cleanup via setup and teardown lifecycle hooks in a custom local component.

  • setup.pythonPackages — installed once via uv pip
  • setup.osPackages — installed once via apt-get / apk / brew
  • setup.commands — run once after packages are ready
  • teardown.commands — run after every invocation

Run:

cd component-setup-teardown && kdeps run workflow.yaml

Single-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, or KDEPS_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.txt

Shows the built-in input component — pre-installed, no kdeps component install needed. Collects named input slots and returns structured JSON.

  • Uses the built-in input component with query, text, and key slots
  • 14 named slots: query, prompt, text, data, key, value, ah
  • Passes collected inputs to an LLM for Q&A
  • Access component output with output('actionId')

Run:

cd input-component && kdeps run workflow.yaml

Quick Start

  1. Choose an example directory
  2. Update database connections if needed
  3. Run: kdeps run workflow.yaml --dev
  4. Test endpoints with curl or your browser

Learning Path

  1. Start with Chatbot - Learn basic YAML, HTTP API, and LLM integration
  2. Advanced SQL - Master database operations, batch processing, and result formatting
  3. Build Your Own - Combine features from examples

Database Setup

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"

Development Mode

Use --dev flag for hot reload during development:

kdeps run workflow.yaml --dev

This automatically restarts the server when you modify workflow files or resources.