Credo: Reusable Declarative Primitives for Agentic Workflows
Organizations: Brown University Providence, RI, USA · Northwestern University Evanston, IL, USA
Abstract
An LLM application depends on both a model and a harness: the program that determines what each call sees, how many calls to make, and which answers to trust. Coding agents can now discover strong harnesses by searching over candidate programs, but the resulting artifact is an opaque block of imperative code whose logical steps, runtime signals, physical execution decisions, and prompt strategies remain implicit and task-specific, forcing subsequent tasks to start the harness search process from scratch. The potential for reuse, however, is substantial. A searched harness encodes significant knowledge, such as the logical steps that work, the signals that matter, the physical operator decisions that adapt execution, and the prompt strategies that are effective, yet this knowledge is buried in imperative code with no inspectable or reusable structure, nor does it carry any provenance or metadata. Credo addresses this problem by recovering a structured declarative description of a searched harness, tagging each extracted primitive with relevant metadata, and cataloguing all of it with provenance. A compiler can then bind stored primitives to generate harnesses for new tasks without having to start the search over from scratch. This paper provides preliminary results demonstrating the potential of our approach and lays out a related research agenda that the database community is well-positioned to tackle, including cost-based compilation over declarative catalogs and catalog maintenance under model and workload drift.
Figures & tables
| Dataset | Domain | Search / In-Distribution Sources | Cross-Distribution Sources |
|---|---|---|---|
| Finance | Retrieval | DocFinQA ( Reddy et al., 2024 ) + FinQA ( Chen et al., 2021 ) | FinanceBench ( Islam et al., 2023 ) + TAT-DQA ( Zhu et al., 2022 ) + TAT-HQA ( Li et al., 2022 ) |
| Legal | Retrieval | CUAD-common ( Hendrycks et al., 2021 ) + MAUD ( Wang et al., 2023b ) | ContractNLI ( Koreeda and Manning, 2021 ) + PrivacyQA ( Ravichander et al., 2019 ) + CUAD-rare ( Hendrycks et al., 2021 ) |
| Math | Reasoning | OlympiadBench ( He et al., 2024 ) + Omni-MATH ( Gao et al., 2024 ) | IMO-AnswerBench ( Luong et al., 2025 ) + IMO-ProofBench ( Luong et al., 2025 ) + ArXivMath ( Dekoninck et al., 2026 ) |
| Polyreason | Reasoning | GPQA-Diamond chem+bio ( Rein et al., 2024 ) | MMLU-Pro law+phil ( Wang et al., 2024 ) + ZebraLogicBench ( Lin et al., 2025 ) + MuSR ( Sprague et al., 2024 ) |
| Round-trip accuracy | Harness ¢/q | Compile | Meta-Harness search | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Domain | Orig | RT | mean | Orig | RT | mean | $ | s | Prop $ | Eval $ | Prop wall | Total wall |
| Finance | 0.293 | 0.304 | 0.171 | 0.170 | 2.79 | 134 | 67 | 1.4 | 41 m | 2.8 h | ||
| Legal | 0.673 | 0.667 | 0.420 | 0.413 | 2.80 | 173 | 72 | 2.6 | 41 m | 4.4 h | ||
| Math | 0.618 | 0.608 | 0.363 | 0.376 | 2.25 | 0 94 | 44 | 4.5 | 30 m | 6.8 h | ||
| Polyreason | 0.710 | 0.717 | 0.130 | 0.119 | 2.42 | 0 98 | 43 | 0.8 | 30 m | 9.2 h | ||
| Domain | L1 (functional) | L2 (source-specific) | Total |
|---|---|---|---|
| Finance | 5.0/6.7/7.3/1.0 | 0.0/2.0/5.3/0.0 | 27.3 |
| Legal | 3.3/7.6/7.7/0.0 | 0.0/3.7/2.7/1.0 | 26.0 |
| Math | 3.0/4.3/5.3/1.7 | 0.0/0.0/0.0/0.0 | 14.4 |
| Polyreason | 2.3/3.3/4.3/2.0 | 0.0/1.0/1.3/0.0 | 14.3 |
LLM Agent Harnesses
LLM agent harnesses are the software and runtime systems that organize an agent’s tools, context, state, execution, and safeguards.
See all 389 papersComposing Task-specific Agent Harnesses at Test Time with Reusable Primitives
Harness as a Language: A Minimalist Agent Framework With Maximal Expressivity
invoke and provides a set of built-in hooks that allow the programmer to apply constraints and perform monitoring. Generalizing existing code-mode agent loops, invoke is the simplest loop that satisfies two defining properties: (1) the LLM can write arbitrary executable code that can include recursive invoke; (2) everything visible to the LLM - all inputs to invoke as well as its interaction history with the code environment - are variables in the code environment. We motivate our design from first principles, viewing invoke as a language primitive representing a function whose implementation is provided at runtime by an LLM every time it is called. To validate the design of our core invoke primitive, we evaluate invoke - with only prompting, no manually designed tools, harness, or external systems (e.g., memory or the file system) - on workflows traditionally implemented through specialized harnesses. On long-horizon workflows requiring recall far beyond the context window, JAZ invoke outperforms Letta (MemGPT) by 8% at half its cost on the recall-heavy portion of StuLife. On continual self-improvement, JAZ invoke outperforms ACE by 4% at a lower cost on AppWorld.