Time estimate: 20 minutes. You’ll need an Anthropic API key and a GCP project.
What you’ll build
Eight resources, wired together. When you apply them, Pragmatiks resolves the dependency graph automatically — secrets first, then the model and the cluster, then the agent and the cluster access, then the runner.Prerequisites
- Python 3.13+
- A Pragmatiks account
- An Anthropic API key
- A GCP project with the Kubernetes Engine API enabled and a service account key
Install the CLI
- uvx (recommended)
- pipx
- pip
Authenticate
Build your agent
1
Create your secret
Secrets store sensitive values like API keys. Create a file called Replace
secret.yaml:secret.yaml
sk-ant-your-key-here with your actual Anthropic API key.2
Create a model
The model resource configures which LLM to use. It references your secret via a field reference — instead of hardcoding the API key, it pulls it from the secret’s outputs.Create The
model.yaml:model.yaml
api_key field uses a field reference: it points to the ANTHROPIC_API_KEY output of the anthropic-key secret. Pragmatiks resolves this automatically.3
Create an agent
The agent resource defines the AI agent’s behavior. It references the model as a dependency — a link to the entire resource, not just one field.Create The
agent.yaml:agent.yaml
model field is a dependency: it references the full claude model resource. When the model changes, the agent rebuilds automatically.4
Deploy it
The runner deploys your agent to a Kubernetes cluster. It needs the agents to deploy, a Then describe the cluster, how to reach it, and the namespace to deploy into. Create The Then deploy the agent. Create
kubernetes/config for cluster access, and a kubernetes/namespace to deploy into.First, store your GCP service account key as a secret. Create gcp-credentials.yaml:gcp-credentials.yaml
cluster.yaml:cluster.yaml
kubernetes/config resource gives Kubernetes resources access to the GKE cluster, and kubernetes/namespace creates the agents namespace in it.GKE cluster creation takes 5-10 minutes. Resources that depend on the cluster wait until it is READY.
runner.yaml:runner.yaml
5
See it work
Check the status of all your resources:You should see all eight resources in Get details about your deployed agent:This shows the runner’s outputs including the service URL where your agent is running.
READY state:What just happened?
You created a dependency chain of resources:- Secret stores your API key securely
- Model references the secret via a field reference (
field: outputs.ANTHROPIC_API_KEY) - Agent depends on the model (whole-resource dependency)
- Cluster:
gcp/gkereads its credentials from a second secret;kubernetes/configgives access to it andkubernetes/namespacecreates theagentsnamespace - Runner depends on the agent, the Kubernetes config, and the namespace
Full YAML
Here’s everything in a single multi-document file you can copy-paste. Createagent-stack.yaml:
agent-stack.yaml
Next steps
Build a Reactive AI Pipeline
Add tools, knowledge bases, and multi-agent teams.
Reactive Dependencies
Understand how change propagation works.