Support Rotations Creep Into Engineering Velocity Supporting large-scale data infrastructure is a continuous battle against ambiguous priorities. At Pinterest, engineers faced an endless stream of complex distributed system failures. Troubleshooting Apache Spark requires navigating noisy logs, complex metrics, and scattered runbooks. Standard solutions rely on engineers manually correlation of trace data. Draško Proferović, a Staff Engineer at the company, realized that while human time is strictly finite, Large Language Model (LLM) capabilities can scale on demand. This spark of insight led to the creation of Medic for Apache Spark, an autonomous agent built to diagnose job failures. The Breakdown of the Single-Prompt Agent The initial prototype used a single reasoning-and-acting (ReAct) agent. It relied on a massive prompt containing solving guidelines, formatting requirements, and historical error examples. It fell flat. Prompt tuning became an unsustainable chore; adjusting instructions in one area instantly broke performance in another. Out-of-memory errors and giant trace logs quickly choked the LLM's context window. To fix this, the team integrated LangFuse for tracing and built an end-to-end test harness that recorded production state, transforming chaotic live errors into reproducible local fixtures. Compressing Raw Data into Token-Friendly Assets To prevent noisy logs and massive metrics from consuming the agent's context window, the engineers built two pipelines. First, they deployed an exception classifier that clusters exceptions and filters out benign red herrings. Second, they isolated metrics analysis into a dedicated sub-agent. Instead of passing raw time-series data, they converted the metrics into annotated dashboard images. The sub-agent reasons visually over these graphs, returning a highly compressed text summary to the coordinator. Orchestrating specialized nodes with LangGraph Today, Medic operates as a multi-agent cooperative system built on LangGraph. A triage agent classifies user intent and determines the job's lifecycle state. Parallel research agents investigate specific failure hypotheses, scoring their findings before passing them to a supervisor. A healer agent then pulls remediations directly from internal runbooks. This modular architecture allows the team to easily scale the system to support other engines like Flink and Trino.
LangGraph
Products
Aug 2025 • 1 videos
High activity month for LangGraph. ArjanCodes among the most active voices, with 1 videos across 1 sources.
Aug 2025
Jul 2026 • 1 videos
High activity month for LangGraph. AI Engineer among the most active voices, with 1 videos across 1 sources.
Jul 2026
- 6 days ago
- Aug 1, 2025