Stigmer Agent Runner — Temporal worker for AI agent execution
Project description
Agent Runner
Python Temporal worker service that executes Graphton agents for Stigmer agent execution.
Quick Start
Docker (Recommended)
# Build and run in container (requires Docker or Podman)
make build-image VERSION=dev-local
make run-local
# View logs
make logs
See Docker Guide for complete container documentation.
Local Python Development
# Install dependencies
poetry install
# Set required environment variables
export TEMPORAL_SERVICE_ADDRESS=localhost:7233
export STIGMER_BACKEND_ENDPOINT=localhost:8080
export AUTH0_DOMAIN=stigmer.auth0.com
export AUTH0_AUDIENCE=https://api.stigmer.ai
export MACHINE_ACCOUNT_CLIENT_ID=your-client-id
export MACHINE_ACCOUNT_CLIENT_SECRET=your-client-secret
export DAYTONA_API_KEY=your-daytona-api-key
# Run worker
python main.py
Execution Modes
The agent-runner supports multiple execution modes via the run.sh launcher script:
1. Production Mode (Extracted Binaries)
Runs from extracted binaries in ~/.stigmer/data/bin/agent-runner/
# Daemon automatically sets STIGMER_AGENT_RUNNER_WORKSPACE
STIGMER_AGENT_RUNNER_WORKSPACE=/path/to/extracted/agent-runner ./run.sh
2. Bazel Mode
Runs via Bazel build system:
bazel run //backend/services/agent-runner
# BUILD_WORKSPACE_DIRECTORY is set automatically by Bazel
3. Development Mode
Runs from source tree (detects workspace by finding MODULE.bazel):
cd backend/services/agent-runner
./run.sh # Automatically finds workspace root
The run.sh script determines the workspace root (where pyproject.toml lives) in this precedence order:
STIGMER_AGENT_RUNNER_WORKSPACE(production/explicit)BUILD_WORKSPACE_DIRECTORY(Bazel)- Directory tree walking (development)
What It Does
Agent Runner is a Python Temporal worker that:
- Executes Graphton agents - Creates agents at runtime and processes user messages
- Manages sandboxes - Session-based Daytona sandbox lifecycle for file persistence
- Streams updates - Real-time execution updates to stigmer-service via gRPC
- Handles skills - Downloads artifacts, extracts to
/bin/skills/{hash}/, injects SKILL.md into prompts - Merges environments - Layers multiple environment configurations
Architecture
Execution Flow
Temporal Workflow (Java) → Python Activities → Graphton Agent
↓
gRPC Status Updates → stigmer-service → MongoDB/Redis
Key Features:
- Real-time status updates every N events
- Progressive visibility (messages, tool calls, phase)
- Session-based sandbox reuse
Resource Resolution
AgentExecution → Session → AgentInstance → Agent → Skills
See Architecture Documentation for complete details.
Development
Type Checking
# Run type checking
make build
Type checking runs automatically in CI before Docker builds.
Environment Variables
| Variable | Description | Required |
|---|---|---|
TEMPORAL_SERVICE_ADDRESS |
Temporal server address | Yes |
STIGMER_BACKEND_ENDPOINT |
Stigmer backend gRPC endpoint | Yes |
AUTH0_DOMAIN |
Auth0 tenant domain | Yes |
AUTH0_AUDIENCE |
Auth0 API audience | Yes |
MACHINE_ACCOUNT_CLIENT_ID |
Machine account client ID | Yes |
MACHINE_ACCOUNT_CLIENT_SECRET |
Machine account client secret | Yes |
DAYTONA_API_KEY |
Daytona API key | Yes |
REDIS_HOST |
Redis host | No (default: localhost) |
REDIS_PORT |
Redis port | No (default: 6379) |
LOG_LEVEL |
Logging level | No (default: INFO) |
Deployment
Docker Container
Local development:
# Build image
make build-image VERSION=dev-$(whoami)
# Run locally (requires Temporal + stigmer-server running)
export STIGMER_LLM_PROVIDER=openai
export STIGMER_LLM_MODEL=gpt-4
export OPENAI_API_KEY=your-key
make run-local
# View logs
make logs
# Stop
make stop
Publishing:
# Authenticate once
make docker-login
# Build and push multi-arch images (production)
make push-multiarch VERSION=1.2.3
See docs/docker.md for complete guide including:
- Multi-stage build architecture
- Security features (non-root user, health checks)
- Volume mounts and persistence
- Network configuration
- Environment variables reference
- Troubleshooting guide
Kubernetes
# Local
kubectl apply -k _kustomize/overlays/local
# Production
kubectl apply -k _kustomize/overlays/prod
Key Features
Session-Based Sandbox Reuse
Sandboxes are created once per session and reused across executions:
- 90% cost reduction for multi-turn conversations
- 2-27s saved per message after first message
- File persistence across conversation turns
Environment Merging
Multiple environments are layered with proper overrides:
agent.env_spec → environment[0] → environment[1] → runtime_env
Skills Integration
Skills provide reusable capabilities (instructions + executable tools) to agents:
- Artifact download & extraction: Downloads ZIP files from R2 storage, extracts to
/bin/skills/{hash}/ - SKILL.md injection: Full interface definition injected into system prompt with LOCATION headers
- Executable access: Scripts and tools available at versioned paths
- Graceful degradation: Falls back to SKILL.md-only if artifacts unavailable
- Content-addressable storage: SHA256 hashing enables deduplication and immutable versioning
See Architecture: Skill Architecture for complete details.
Documentation
Complete documentation: docs/README.md
Key documents:
- Architecture: Agent Execution Workflow
- Architecture: Skill Architecture
- Guide: Working with Agent Execution
- Architecture: Data Model
- Implementation: Type Checking
Related Services
- stigmer-service - Java orchestration service with gRPC APIs
- workflow-runner - Go Temporal workflow execution service
Dependencies
- Graphton - Python framework for LLM agents
- Temporal - Workflow orchestration platform
- Daytona - Development sandbox platform
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stigmer_runner-0.3.2.tar.gz.
File metadata
- Download URL: stigmer_runner-0.3.2.tar.gz
- Upload date:
- Size: 655.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6273761dd0485a837d61ac6033d5134c8ab4f7e27e4594e7d99d6bf03c31244a
|
|
| MD5 |
a5fd6d5b2320c4682c35371292a222cb
|
|
| BLAKE2b-256 |
9ba78dec7b89cc9b1fc204b0d8d1c15f3fe52a377bf7162c06c18dfd1fb8d656
|
Provenance
The following attestation bundles were made for stigmer_runner-0.3.2.tar.gz:
Publisher:
release.python-runner.yaml on stigmer/stigmer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stigmer_runner-0.3.2.tar.gz -
Subject digest:
6273761dd0485a837d61ac6033d5134c8ab4f7e27e4594e7d99d6bf03c31244a - Sigstore transparency entry: 1428641284
- Sigstore integration time:
-
Permalink:
stigmer/stigmer@32a9d0803c97cb026aad732823bc8c1d74a2d111 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/stigmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.python-runner.yaml@32a9d0803c97cb026aad732823bc8c1d74a2d111 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stigmer_runner-0.3.2-py3-none-any.whl.
File metadata
- Download URL: stigmer_runner-0.3.2-py3-none-any.whl
- Upload date:
- Size: 249.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa7d0dca32f3d2f169d54bf7e03576011f58da3ac195388b173895d2c05354ec
|
|
| MD5 |
f9578429f44869db904e149ed26a3950
|
|
| BLAKE2b-256 |
35a3ec3a71b102ac228c6021b0ac3c5491ea102c3a82df87366b9a9c52164dc6
|
Provenance
The following attestation bundles were made for stigmer_runner-0.3.2-py3-none-any.whl:
Publisher:
release.python-runner.yaml on stigmer/stigmer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stigmer_runner-0.3.2-py3-none-any.whl -
Subject digest:
fa7d0dca32f3d2f169d54bf7e03576011f58da3ac195388b173895d2c05354ec - Sigstore transparency entry: 1428641349
- Sigstore integration time:
-
Permalink:
stigmer/stigmer@32a9d0803c97cb026aad732823bc8c1d74a2d111 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/stigmer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.python-runner.yaml@32a9d0803c97cb026aad732823bc8c1d74a2d111 -
Trigger Event:
push
-
Statement type: