Skip to main content
This guide walks through building a reactive AI pipeline where changing one resource automatically propagates updates through the entire dependency chain.

What You’ll Build

A three-layer pipeline where:
  1. A secret stores an API key
  2. A model references the secret
  3. An agent depends on the model
When you change the secret, the model and agent automatically rebuild.

Prerequisites

  • pragma CLI installed and authenticated
  • Agno provider deployed (pragma providers list to verify)

Step 1: Define the Pipeline

Create a file called pipeline.yaml with all three resources:

Step 2: Apply Everything at Once

Pragmatiks resolves the dependency order automatically:
  1. The secret is processed first (no dependencies)
  2. Once the secret is ready, the model’s FieldReference resolves and the model is processed
  3. Once the model is ready, the agent’s Dependency resolves and the agent is processed
Watch the progress:
After a few moments:

Step 3: Trigger a Change

Now swap the model. Update pipeline.yaml to use a different model ID:
Apply just the model:
Since only the model’s config changed, Pragmatiks:
  1. Re-processes the model with the new model_id
  2. Detects that assistant depends on claude
  3. Automatically re-processes the agent with the updated model data
The agent rebuilds without you touching it.

Step 4: Inspect the Resolution

To see how Pragmatiks resolved the dependencies, inspect the resolved config:
The output shows:
  • config — Your original YAML with Dependency markers
  • resolved_config — The fully resolved version with actual model data embedded

FieldReference Patterns

Single Value References

Reference a specific output field:

Multiple References

A single resource can reference multiple dependencies:

Debugging Tips

Check dependency states

If a resource is stuck in pending, its dependencies might not be ready:
Look at the Dependencies section to see what it’s waiting on.

Compare config vs resolved_config

  • If resolved_config is null, the resource is waiting for dependencies
  • If resolved_config has values, the resource has been submitted to the provider
  • Compare the two to verify references resolved correctly

Force re-processing

If a resource should have updated but didn’t, re-apply it:
Idempotent apply means unchanged resources are skipped, and only modified resources are re-processed.

Next Steps

Reactive Dependencies

Deep dive into the dependency resolution system.

File Uploads

Add file resources to your pipelines.