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. 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 loop 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:Workflow

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.