Skip to content

Concepts overview

The mental model behind kdeps: how a workflow is shaped, how data moves between steps, and which pieces apply to each mode. If you have not run kdeps yet, read What is kdeps? first.

How a workflow is shaped

A kdeps project is a folder. workflow.yaml is the manifest - name, version, and targetActionId (the resource that produces the final result). Every other .yaml file under resources/ is a single resource: one LLM call, one SQL query, one shell command, one HTTP request. A resource lists what it requires:, and kdeps runs the resources in that dependency order, passing each one's output forward. That ordered graph is the workflow.

The tables below group every concept by what it does. Start with the two modes, then reach for the rest as you need them.

The two modes

ConceptWhat it isMode
Workflow modeA DAG of resources that runs in dependency order and returns a responseWorkflow
Agent modeAn LLM that calls workflows, components, and built-in tools to finish a taskAgent
AgenciesSeveral agents bundled under one agency.yaml, calling each other with agent:Both
ComponentsReusable resource bundles you install or build, invoked with component:Both

Wiring data between steps

ConceptWhat it isMode
Expressionsexpr-lang snippets in , before:/after:, and check:Both
Expression helpersJson(), Safe(), Debug(), default() and other utilitiesBoth
Data accessget()/set() plus the input and request shorthandsBoth (input/request: workflow)
Tools (function calling)Let a chat: resource call other resources mid-responseWorkflow
Inline resourceschat/sql/python/... actions nested in a resource's before:/after:Both

Control flow and input

ConceptWhat it isMode
Validation and controlThe validations: block - skip, preflight check, route/method limits, input schemaWorkflow
Error handling (onError)Retry, fallback value, or fail on a resource errorWorkflow
Items iterationRun a resource once per list entry (for-each)Both
While-loopRepeat a resource while a condition holds; every: for scheduled tasksBoth
Input sourcesFeed a workflow from an HTTP API, a chat bot, or a fileWorkflow
Jinja2 templatesYAML preprocessing and project scaffoldingBoth

State

ConceptWhat it isMode
Session storageValues that persist across requests from the same callerWorkflow
Persistent memoryProject-scoped facts the agent recalls across sessionsAgent (tools also work in workflow)
Memory internalsAuto-extraction, the memory graph, and prompt injectionAgent

Released under the Apache 2.0 License.