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')

The one action ​

yaml
# resources/my-resource.yaml
actionId: myResource        # required: unique ID -- used by requires: and get()

# 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
agent: { ... }       # run another agent's full workflow; output is its apiResponse
apiResponse: { ... } # build the HTTP response returned to the caller
component:           # call a shipped or installed component:
  name: http_request #   make an HTTP request; output is the parsed response body
  with:
    method: GET
    url: https://api.example.com/data

The tables under Resource types are the allowlist. An action listed there as component: is called only that way - a workflow that uses its native key (exec:, python:, embedding:, searchLocal:, httpClient:, loader:, vectorStore:, ...) as a primary action or in a before:/after: step is rejected at parse time, and the error names the component. Actions listed as a plain YAML key have no bundled component and run natively.

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
component: load_documentLoad PDF, HTML, CSV, text, or a directory into text chunks - a kdeps component, YAML onlyLoader
component: embeddingLocal SQLite keyword store: index / search / upsert / delete - a kdeps component, YAML onlyEmbedding
component: vector_storeExternal vector DB: Qdrant, Chroma, Pinecone, pgvector, ... - a kdeps component, YAML onlyVector store
component: transcribe_audioSpeech to text via a Whisper API (OpenAI, Groq, local) - a kdeps component, YAML onlyTranscribe
component: transcribe_audio_offlineSpeech to text offline via whisper.cpp - a kdeps component, YAML onlyTranscribe
component: ocr_imageText from an image via tesseract - local, no API key (a kdeps component, YAML only)OCR

Web ​

YAML keyDescriptionPage
component: http_requestHTTP requests - APIs, webhooks, auth, retry, cache - a kdeps component, YAML onlyHTTP client
component: search_localGlob + keyword search across local files - a kdeps component, YAML onlysearch_local

Data & system ​

YAML keyDescriptionPage
component: sqlDatabase queries and transactions - a kdeps component, YAML onlySQL
component: fileRead, write, patch, list, delete, copy, move files - a kdeps component, YAML onlyFile
component: gitStatus, diff, log, commit, branch, push, pull - a kdeps component, YAML onlyGit
component: pythonRun a Python script, stdout parsed as JSON - a kdeps component, YAML onlyPython
component: execRun a shell command, structured {success, exitCode, stdout, stderr, ...} - a kdeps component, YAML onlyExec

Messaging ​

YAML keyDescriptionPage
apiResponse (bot mode)The workflow result is sent to the chat platform that delivered the messageBot replies

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 install) ​

Some install names (embedding) also exist as kdeps components; the registry component is a separate package, and installing it takes the place of the shipped component.

Install nameDescription
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.