Quickstart
Prerequisites
bash
# Install via script (Mac/Linux)
curl -LsSf https://raw.githubusercontent.com/kdeps/kdeps/main/install.sh | shCreate a project
bash
kdeps new my-agent
cd my-agentOr manually create the structure:
bash
mkdir my-agent && cd my-agent && mkdir resourcesDefine your workflow
workflow.yaml:
yaml
apiVersion: kdeps.io/v1
kind: Workflow
metadata:
name: my-agent
version: "1.0.0"
targetActionId: responseResource
settings:
apiServerMode: true
apiServer:
hostIp: "127.0.0.1"
portNum: 16395
routes:
- path: /api/v1/chat
methods: [POST]Add an LLM resource
resources/llm.yaml:
yaml
apiVersion: kdeps.io/v1
kind: Resource
metadata:
actionId: llmResource
run:
validations:
methods: [POST]
routes: [/api/v1/chat]
check:
- get('q') != ''
error:
code: 400
message: Query parameter 'q' is required
chat:
model: llama3.2:1b
role: user
prompt: "{{ get('q') }}"
timeout: 60sAdd a response resource
resources/response.yaml:
yaml
apiVersion: kdeps.io/v1
kind: Resource
metadata:
actionId: responseResource
requires: [llmResource]
run:
apiResponse:
success: true
response:
data: get('llmResource')Run it
bash
kdeps run workflow.yamlTest the API:
bash
curl -X POST http://localhost:16395/api/v1/chat \
-H "Content-Type: application/json" \
-d '{"q": "What is AI?"}'How it works
- Request arrives at
/api/v1/chatwith{"q": "..."} - Validation checks
qis not empty - LLM resource sends the prompt to the model
- Response resource formats the output
- API responds with the result