Databricks' coSTAR for AI Agents

Databricks details its coSTAR methodology for rapidly and safely deploying AI agents, addressing key testing challenges.

3 min read
Diagram illustrating the Databricks coSTAR framework with two coupled STAR loops.
Image credit: StartupHub.ai

Shipping complex AI agents without introducing regressions is a significant engineering challenge. Imagine a coding assistant refactoring your codebase without a robust test suite; it's a recipe for disaster. Databricks, a leader in unified data analytics and AI, has detailed its approach to tackling this problem with a system called coSTAR (coupled Scenario, Trace, Assess, Refine). This methodology is crucial for iterating quickly on AI agents that perform tasks ranging from developing new platform features to automating internal engineering workflows, as outlined in their blog post.

The core issue Databricks faced was the inherent difficulty in testing AI agents. Unlike deterministic software, agent outputs can be non-deterministic, feedback loops are slow, errors can cascade, and judging output quality is often subjective. These factors make traditional testing methods inadequate. Databricks AI Agents, like many advanced AI systems, require a new paradigm for validation.

The coSTAR Framework

coSTAR mirrors the familiar software development lifecycle but adapts it for AI agents. It employs two coupled loops: one that aligns AI 'judges' with human expert assessments, and another that uses these trusted judges to automatically refine the agent's performance against predefined scenarios. This creates a robust system for continuous integration and deployment.

Scenario Definitions: The Test Fixtures

At the foundation of coSTAR are scenario definitions. These structured descriptions act as test fixtures, outlining the initial state, user prompts, and expected outcomes for an agent. By creating a comprehensive suite of scenarios covering common, edge, and failure cases, Databricks ensures that agent development is deliberate and that scenarios are reusable across different agent versions.

Trace Capture: The Flight Recorder

Every agent execution under coSTAR generates an MLflow trace. This detailed log captures every tool call, intermediate output, and artifact produced by the agent. Decoupling execution from scoring allows for efficient re-evaluation of traces as judges are refined, enabling faster iteration without costly re-runs.

Assess with Judges: Evaluating Performance

Judges, often implemented as specialized AI agents themselves, analyze these traces. They evaluate specific properties of the agent's execution, moving beyond simple pass/fail assertions. These judges can perform deterministic checks like code syntax validation or output schema verification, as well as subjective assessments of code quality or adherence to best practices. This approach is vital for the contextual understanding required by modern data agents.

Testing the Tests: Judge Alignment

A critical component of coSTAR is judge alignment. This process ensures that the AI judges accurately reflect human expert judgment. By comparing judge assessments against human-scored traces, Databricks continuously refines the judges, building confidence that the automated evaluations are reliable. This addresses the 'flaky test' problem common in traditional software development and is essential for the safe deployment of Databricks AI Agents.

The methodology also incorporates operational metrics like token usage and latency as early warning signals, even when functional judges pass. This holistic approach allows Databricks to ship AI agents rapidly and reliably, pushing the boundaries of AI agent development.