Skip to content

Resources overview

A resource is a single step in a workflow. It has an ID, optional dependencies, optional validation, and exactly one action. kdeps builds a dependency graph from all resources and runs them in order.

Where it runs

All resource types work in both workflow mode and agent mode. In workflow mode, resources execute as DAG steps ordered by requires:. In agent mode, whole workflows are registered as callable tools - the LLM invokes a workflow as a unit, and all resource dependencies inside it resolve correctly.

The shape of a resource

yaml
# resources/my-resource.yaml
actionId: myResource        # required: unique ID -- used by requires: and get()
name: My Resource           # required: human-readable label
description: What it does   # optional
category: api               # optional grouping label

requires:                   # like imports -- these run first and must produce output
  - otherResource           # myResource will not run until otherResource is done

items:                      # optional: run this resource once per item -- see /workflow/items
  - item1
  - item2

loop:                       # optional: repeat while a condition holds -- see /workflow/loop
  while: "loop.index() < 5"

# Gate whether the resource runs at all -- see /workflow/validation
validations:
  methods: [POST]                # only run on POST requests
  routes: [/api/v1/endpoint]    # only run on this route
  headers: [Authorization]      # only run when this header is present
  params: [q, limit]            # only run when these params are present
  skip:
    - get('skip') == true       # skip silently if true
  check:
    - get('q') != ''            # fail with the error below if false
  error:
    code: 400
    message: Query required

# Expressions that run around the action -- see /workflow/expressions
before:                 # prepare values the action reads
  - set('pre', 'value')
after:                  # process the output for downstream resources
  - set('post', 'value')

# Exactly one primary action per resource (apiResponse: may accompany it
# on the same resource to format the HTTP response):
chat: { ... }        # send a prompt to an LLM; reply text at .message.content
httpClient: { ... }  # make an HTTP request; output is the parsed response body
sql: { ... }         # run a SQL query; output is the row set
python: { ... }      # run a Python script; output is its stdout (parsed as JSON)
exec: { ... }        # run a shell command; output is its stdout
email: { ... }       # send SMTP email or read/search/modify IMAP messages
telephony: { ... }   # in-call action (say, ask, menu, ...); output is TwiML
botReply: { ... }    # reply to the bot platform that delivered the message
file: { ... }       # filesystem operations: read, write, patch, list, delete
git: { ... }        # version control: status, diff, log, commit, push, pull
codeIntelligence: { ... }  # code navigation: search, definitions, diagnostics
agent: { ... }       # run another agent's full workflow; output is its apiResponse
apiResponse: { ... } # build the HTTP response returned to the caller
component:           # call an installable registry component
  name: botreply
  with:
    platform: telegram
    message: "Hello!"

actionId and requires

actionId is the resource's unique name. It is what targetActionId points to, and the key you pass to get() to read the resource's output.

yaml
# resources/response.yaml
actionId: response
name: API Response
requires: [llm]          # response will not run until llm is done
apiResponse:
  response:
    answer: get('llm').message.content   # reply text from the llm resource

requires: lists direct dependencies only. kdeps resolves transitive dependencies automatically - you do not list the whole chain.

Resource types

All executors are compiled into the kdeps binary and require no installation. They are grouped here by function; each links to its own reference page.

AI & language

YAML keyDescriptionPage
chatLLM interaction - responses, generation, tools, visionLLM
chat (routing)Delegate model choice to config / auto-fitLLM routing
-Model backends, providers, API keysLLM backends
loaderLoad PDF, HTML, CSV, text, or a directory into text chunksLoader
embeddingLocal SQLite keyword store: index / search / upsert / deleteEmbedding
vectorStoreExternal vector DB: Qdrant, Chroma, Pinecone, pgvector, ...Vector store
transcribeSpeech to text via Whisper (OpenAI, Groq, local, offline)Transcribe
ocrText from an image via tesseract - local, no API keyOCR

Web

YAML keyDescriptionPage
httpClientHTTP requests - APIs, webhooks, auth, retry, cacheHTTP client
scraperFetch a URL and extract text, optional CSS selectorScraper
browserPlaywright browser - navigation, forms, JS, screenshotsBrowser
searchLocalGlob + keyword search across local filessearchLocal
searchWebWeb search: DuckDuckGo (default), Brave, Bing, TavilysearchWeb

Data & system

YAML keyDescriptionPage
sqlDatabase queries and transactionsSQL
fileRead, write, patch, list, delete, copy, move filesFile
gitStatus, diff, log, commit, branch, push, pullGit
pythonRun a Python script, stdout parsed as JSONPython
execRun a shell command, stdout capturedExec
codeIntelligenceSymbol search, definitions, references, folder graphCode intelligence · folder graph

Messaging

YAML keyDescriptionPage
emailSMTP send, IMAP read / search / modifyEmail
telephonyVoice call handling (say, ask, menu, dial, record)Telephony
botReplyReply to the chat platform that delivered the messageBot reply

Orchestration

YAML keyDescriptionPage
agentCall another agent in an agencyAgent
componentCall a reusable resource bundleComponent
apiResponseReturn data to the HTTP callerAPI response

Registry components (installable via kdeps registry install)

Some install names (scraper, browser, embedding) also exist as native YAML keys. The native action is compiled into the binary; the registry component is a separate, richer package. They are not interchangeable.

Install nameDescription
scraperExtended content extraction: PDFs, .docx, .xlsx, images (type auto-detected)
browserPlaywright browser with stealth mode, persistent sessions, and file upload
botreplyChat bot reply (Discord, Slack, Telegram, WhatsApp)
embeddingVector embeddings via OpenAI Embeddings API
searchWeb search via Tavily API

See the Components guide for installation and usage details.

Execution flow

RequestRoute MatchingBuild Dep GraphFor each resource (in order)Return TargetResponseCheck RouteskipCheck Skipskip silentlyPreflight Checkerrorexecute before:Execute Actionexecute after:Store Outputnot matchingcondition truevalidation fails

See also

Released under the Apache 2.0 License.