How Rescale Built an AI Triage Agent Using Strands Agents and AI-DLC
- Authors

- Name
- Nino
- Occupation
- Senior Tech Editor
Modern continuous integration and deployment (CI/CD) pipelines generate thousands of automated integration, regression, and unit test results daily. For high-performance computing (HPC) software platforms like Rescale, isolating flaky tests, system regressions, infrastructure timeouts, and application logic bugs requires hundreds of engineering hours every sprint. To eliminate this operational bottleneck, Rescale leveraged the AI-Driven Development Lifecycle (AI-DLC) framework alongside Strands Agents to design, prototype, and scale an autonomous test-triage agent in weeks.
In this technical review, we dissect the architectural blueprints, workflow automation, prompting strategies, and enterprise infrastructure that power Rescale's triage agent. We also examine how enterprise engineering teams can implement similar agentic architectures using flexible API aggregators like n1n.ai to maintain high availability and low latency across heterogeneous foundation models.
The Operational Problem: The Test Triage Tax
In high-frequency delivery workflows, the primary failure mode of software validation is not finding defects; it is the sheer volume of diagnostic noise. When hundreds of distributed end-to-end integration tests fail across parallel worker nodes, developers face several challenges:
- Diagnostic Latency: Sifting through megabytes of unformatted console logs, stack traces, and network dumps takes an average of 15 to 45 minutes per failing run.
- False Positives vs. Real Regressions: Flaky tests caused by transient network spikes, race conditions, or third-party API throttling mask true regressions.
- Context Switching: Engineers frequently switch away from core feature development to determine whether a failure is caused by their pull request or an outdated mock server.
Rescale addressed this bottleneck by transitioning from reactive human triage to an autonomous triage agent built on the AI-DLC paradigm.
What is AI-DLC (AI-Driven Development Lifecycle)?
The AI-Driven Development Lifecycle is a structured software delivery methodology that integrates foundation models as first-class decision-makers and co-developers across every phase of software delivery. While traditional SDLC applies automation solely through static linters, deterministic unit tests, and continuous deployment scripts, AI-DLC introduces continuous semantic reasoning into the engineering loop.
Traditional SDLC: [Spec] ──> [Code] ──> [CI/CD Build] ──> [Deterministic Test] ──> [Manual Triage] ──> [Release]
AI-DLC Loop: [Spec] ──> [AI Synthesis] ──> [Build] ──> [Test Execution]
▲ │
└─── [AI Triage Agent] ◄──────────┘
├─ Log Parsing & Classification
├─ Root Cause Analysis (RCA)
└─ Auto-remediation / PR Draft
Key pillars of AI-DLC within test engineering include:
- Autonomous Artifact Extraction: Extracting structural runtime telemetry, call traces, and environment state variables directly from failed jobs.
- Semantic Log Clustering: Grouping failures by failure mechanisms rather than literal string matches.
- Dynamic Context Augmentation: Supplying the LLM with relevant git diffs, historical bug databases, and infrastructure health metrics.
- Actionable Synthesis: Producing actionable remediation summaries, opening deduplicated issue tickets, and dispatching self-healing workflows.
Architectural Deep Dive: Strands Agents and Foundation Models
Rescale adopted Strands Agents—a modular framework designed to orchestrate stateful, multi-step LLM interactions—deployed on top of Amazon Web Services (AWS) using Amazon Bedrock. The system delegates distinct subtasks to specialized micro-agents coordinated by an orchestrator.
┌────────────────────────────────────────────────────────────────────────┐
│ Continuous Integration (CI) │
│ (GitHub Actions / Jenkins / GitLab CI) │
└───────────────────────────────────┬────────────────────────────────────┘
│ Webhook / Event Stream
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Strands Ingestion Pipeline │
│ ├─ Telemetry Sanitizer (strips secrets, tokens, PII) │
│ ├─ Noise Reducer (removes heartbeats, recurring info logs) │
│ └─ Chunking Engine (semantic code & stack-trace slicing) │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Strands Agent Orchestration Core │
│ │
│ ┌───────────────────────┐ ┌───────────────────────────────┐ │
│ │ Classifier Agent │ │ Root Cause Analyzer │ │
│ │ (Infra vs Code vs UI) │ ───────> │ (Evaluates Diffs & Traces) │ │
│ └───────────────────────┘ └───────────────┬───────────────┘ │
│ ▲ │ │
│ │ Vector Context │ Tool Calls │
│ ┌──────────┴────────────┐ ┌───────────────▼───────────────┐ │
│ │ Historical Vector DB │ │ Action Executor │ │
│ │ (OpenSearch / pgvector)│ │ (Jira / Slack / GitHub API) │ │
│ └───────────────────────┘ └───────────────────────────────┘ │
└───────────────────────────────────┬────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────────────────────┐
│ Developer Feedback Loop & Automated Actions │
│ - Auto-quarantine Flaky Test │
│ - Post Root Cause Analysis in PR Comments │
│ - Rerun transient timeouts │
└────────────────────────────────────────────────────────────────────────┘
1. Ingestion and Noise Filtration
Uncompressed test logs often exceed hundreds of thousands of lines. Feeding raw telemetry directly into an LLM context window causes token exhaustion and degraded retrieval accuracy. Rescale's ingestion pipeline implements pre-processors that:
- Extract the tail execution frame around fatal exceptions.
- Filter repetitive standard output.
- Scrub credentials, hostnames, and IP addresses to maintain zero-trust compliance.
2. Specialized Multi-Agent Roles
Rather than asking a single prompt to parse, analyze, and report errors, Strands Agents employs role specialization:
- The Triage Classifier: Uses a fast, low-latency model to identify failure archetypes (e.g.,
TIMEOUT,INFRASTRUCTURE_FAILURE,FLAKY_ASSERTION,LOGIC_BUG). - The Context Retrieval Agent: Queries vector stores containing historical test runs, git commit diffs, and Jira issues to find correlation patterns.
- The Synthesis Agent: Formulates clear markdown reports outlining root causes, confidence scores, and remediation steps.
For production workflows requiring rapid switching between models like Claude 3.5 Sonnet, GPT-4o, and DeepSeek-V3, engineering teams often leverage high-speed model aggregation gateways like n1n.ai to optimize per-token costs and eliminate regional endpoint rate-limit constraints.
Implementation: Building an Autonomous Triage Worker in Python
Below is an implementation of an agentic test-triage runner. It parses an execution payload, queries an LLM endpoint, and executes structured root cause determination with schema validation.
import os
import json
from typing import Dict, Any, List, Optional
from pydantic import BaseModel, Field
import requests
# Pydantic Schema for Guaranteed LLM Output
class TriageAnalysis(BaseModel):
failure_category: str = Field(description="Category: INFRASTRUCTURE, FLAKY, CODE_DEFECT, CONFIGURATION")
root_cause_summary: str = Field(description="Concise technical summary of why the test failed")
confidence_score: float = Field(description="Confidence score between 0.0 and 1.0")
affected_files: List[str] = Field(description="Source files implicated by the trace")
suggested_action: str = Field(description="Actionable next steps: RERUN, QUARANTINE, FILE_BUG, FIX_DIFF")
class TestTriageAgent:
def __init__(self, api_key: str, base_url: str = "https://api.n1n.ai/v1"):
self.api_key = api_key
self.base_url = base_url
self.headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
def sanitize_log(self, raw_log: str, max_lines: int = 200) -> str:
"""Extract relevant failure window from raw console output."""
lines = raw_log.splitlines()
error_indices = [i for i, line in enumerate(lines) if "ERROR" in line or "FAIL" in line or "Traceback" in line]
if not error_indices:
# Return the tail if no explicit error tokens found
return "\n".join(lines[-max_lines:])
# Slices window starting slightly before first error until end
start_line = max(0, error_indices[0] - 15)
return "\n".join(lines[start_line:start_line + max_lines])
def evaluate_failure(self, test_name: str, sanitized_trace: str, git_diff: str) -> TriageAnalysis:
system_prompt = (
"You are an automated CI/CD Diagnostic Agent. Analyze test logs and commit diffs.\n"
"Classify the failure into: INFRASTRUCTURE, FLAKY, CODE_DEFECT, or CONFIGURATION.\n"
"Output strictly valid JSON conforming to the schema."
)
user_prompt = f"""Test Case: {test_name}
=== RECENT GIT DIFF ===
{git_diff[:2500]}
=== SANITIZED TRACEBACK ===
{sanitized_trace}
"""
payload = {
"model": "claude-3-5-sonnet-20241022",
"messages": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt}
],
"response_format": {"type": "json_object"},
"temperature": 0.1
}
response = requests.post(f"{self.base_url}/chat/completions", headers=self.headers, json=payload)
response.raise_for_status()
result_json = response.json()["choices"][0]["message"]["content"]
data = json.loads(result_json)
return TriageAnalysis(**data)
# Execution Example
if __name__ == "__main__":
# Initialize with n1n.ai unified API gateway
API_KEY = os.getenv("N1N_API_KEY", "sk-test-key")
agent = TestTriageAgent(api_key=API_KEY, base_url="https://api.n1n.ai/v1")
mock_log = """
[INFO] Starting TestRun: test_hpc_cluster_provisioning
[DEBUG] Allocating worker nodes AWS c5.4xlarge... OK
[ERROR] ConnectionResetError: [Errno 104] Connection reset by peer
Traceback (most recent call last):
File "/opt/rescale/tests/test_hpc.py", line 142, in test_hpc_cluster_provisioning
cluster.await_ready(timeout=60)
File "/opt/rescale/core/cluster.py", line 89, in await_ready
raise TimeoutError("Cluster orchestration timed out after 60s")
TimeoutError: Cluster orchestration timed out after 60s
"""
mock_diff = """
diff --git a/rescale/core/cluster.py b/rescale/core/cluster.py
- cluster.await_ready(timeout=180)
+ cluster.await_ready(timeout=60)
"""
sanitized = agent.sanitize_log(mock_log)
analysis = agent.evaluate_failure("test_hpc_cluster_provisioning", sanitized, mock_diff)
print("Triage Verdict:", analysis.json(indent=2))
Architectural Comparison: Traditional vs. Agentic Triage
| Evaluation Metric | Traditional Manual Triage | Regex / Static Parser Rules | Strands Agents + AI-DLC |
|---|---|---|---|
| Time to Triage | 15–45 minutes / failure | < 5 seconds / failure | 10–30 seconds / failure |
| Handling Novel Bugs | Excellent (Human context) | Zero (Requires updated regex) | High (Generalization via LLM) |
| Flaky Test Identification | Subjective, inconsistent | Poor, rigid thresholds | Statistical & Contextual reasoning |
| Maintenance Overhead | High engineering cost | High pattern-file debt | Low (Self-adjusting prompts) |
| Actionable Output | Manual bug filing | Simple alerting | Auto-PR comments, Jira filing, Rerun |
Strategic Advantages of AI-DLC at Enterprise Scale
Rescale's rollout demonstrates how AI-assisted continuous engineering reduces mean time to resolution (MTTR) while boosting developer satisfaction:
- Zero-Day Flaky Detection: By maintaining rolling embeddings of test failures across branches, the agent instantly differentiates between a brand-new syntax bug and an infrastructure timeout that occurred 40 times in the past month.
- De-duplicated Ticketing: The agent fingerprints failures semantically rather than textually. If twenty microservice tests fail due to an expired OAuth credential, the agent files a single ticket with twenty references, rather than flooding Jira.
- Tight Loop Feedback: Instead of waiting for an engineer to come online in another timezone, pull requests receive immediate actionable diagnoses directly within GitHub checks.
Pro Tips for Designing Agentic CI/CD Workflows
- Pro Tip 1: Implement Layered Caching: Test failures often repeat identical stack traces across parallel CI matrix runners. Hash your sanitized traceback strings; if an identical failure occurred in the last 60 minutes, reuse the LLM diagnosis from cache.
- Pro Tip 2: Decouple Models via an Aggregator: Model deprecations, API rate-limits, and provider outages can break CI pipelines. By routing requests through an enterprise gateway like n1n.ai, you can fall back dynamically from Claude 3.5 Sonnet to GPT-4o or DeepSeek-V3 without modifying client-side application code.
- Pro Tip 3: Strict JSON Schema Guardrails: Never allow your agents to output freeform markdown directly to ticketing APIs. Always enforce schema validation (such as Pydantic or structured tool calling) to ensure deterministic ingestion by downstream CI tools.
Conclusion
Rescale's implementation of an autonomous test-triage agent demonstrates that the AI-Driven Development Lifecycle is no longer a theoretical ideal—it is a proven competitive edge for high-velocity software engineering organizations. By coupling Strands Agents with robust multi-model pipelines, Rescale shifted hundreds of engineering hours from debugging terminal logs back to shipping core features.
Get a free API key at n1n.ai