kdeps workflow reference
This page lists every field and option. The overview shows what it does and a first example.
A kdeps workflow is a deterministic YAML pipeline. A request arrives, resources run in dependency order, and kdeps returns the result. The same input always has the same execution path. For this reason, the workflow is auditable and testable, and it can run safely without supervision. Serve it as an HTTP API, a file processor, an interactive prompt, or with listeners (a chat bot, a webhook, a followed file).
kdeps run ./my-agent/ # run once / serve on :16395A chat with loop: in this file is an agent. To run several workflows as one system, see Agencies. To ship the file, see Deploy.
If the workflow has no chat: resource, kdeps does not download a model or start an LLM server. /health binds immediately. Models download on the first chat request.
How it works
A resource runs only after everything in its requires: has produced output. Resources with no shared dependency path run concurrently.
One file
The same workflow.yaml runs as an HTTP API, a file processor, an interactive prompt, or with listeners (a chat bot, a webhook, a followed file). A failed check returns 400 before any model call. A chat with loop: is one step. maxRounds stops that step.
Minimal example
The two-resource chat API, the auth token, and the curl are on the workflow quickstart. /health is exempt from that token. /_kdeps/* management routes use KDEPS_MANAGEMENT_TOKEN instead. See Security reference.
Input sources
A workflow gets input from four places. Set them in deploy:
# API (default) - starts an HTTP server
deploy:
apiServer:
portNum: 16395
routes:
- path: /api/v1/chat
methods: [POST]
# Listeners - one run per event; blocks until SIGINT
deploy:
input:
listen:
- listener: telegram_updates # a chat bot; reply with the telegram_post component
# File - reads one file from disk or stdin, runs once, exits
deploy:
input:
sources: [file]
file:
path: /data/input.txt
# Interactive - each line runs the workflow
deploy:
input:
sources: [interactive]See Input sources for full configuration.
Agent memory (--memory)
A workflow can use the agent memory notes. Pass --memory to enable:
kdeps run workflow.yaml --memory
kdeps exec my-agent --memoryWhen enabled, four expression functions become available in resource YAML:
| Function | Description |
|---|---|
memory_save(key, value) | Save a key-value pair to persistent memory |
memory_search(query) | Search memory entries by content (returns JSON array) |
memory_list() | List all memory keys |
memory_delete(key) | Delete a memory entry by key |
Memory persists across workflow runs as notes in the knowledge vault's Memory/ folder (default ~/.kdeps/notes/Memory/). Use it to carry state between invocations:
# resources/llm.yaml
actionId: llm
before:
- memory_save('last_query', get('q'))
chat:
model:
name: llama3.2:1b
context:
prompt: |
Previous context: {{ memory_search('user preference') }}
Answer: {{ get('q') }}# resources/response.yaml
actionId: response
flow:
requires: [llm]
before:
- memory_save('last_response', get('llm').message.content)
apiResponse:
success: true
response:
answer: get('llm').message.contentkdeps automatically links memory entries into a relationship graph. The graph shows the chain from the prompt to the tool calls and to the results.
See also
- Workflow configuration - Full
workflow.yamlreference - Resources overview - Resource types and fields
- Agent loop - a chat with
loop:
