FlowBank: Query-Adaptive Agentic Workflows Optimization through Precompute-and-Reuse
Abstract
An agentic system's capabilities depend on both its language model and the harness that organizes its work. Workflow design optimizes a central part of the harness: how a task is decomposed, which roles agents assume, and how their outputs are coordinated and checked. However, current agentic workflow optimization paradigms make an unsatisfying trade-off. Task-level methods search offline but deploy only a single workflow, leaving complementary candidates unused, while query-level generators synthesize a new workflow for each query at substantial inference cost. Our motivating analysis shows that workflows discovered offline solve different subsets of queries, and many queries handled by expensive query-level generation can already be solved by cheaper precomputed workflows. These observations motivate precompute-and-reuse: building a compact bank of complementary workflows offline and selecting among them adaptively at inference time. Doing so requires solving three coupled problems: generating complementary rather than redundant candidates, compressing them into a deployable portfolio, and assigning each query to the right workflow under a performance–cost trade-off. To this end, we present FlowBank, a precompute-and-reuse framework for portfolio-based agentic workflow optimization. Diversifying uses DiverseFlow to steer search toward under-covered queries and produce a high-coverage candidate pool. Curating proposes CuraFlow to compress this pool into a compact portfolio with minimal redundancy. Matching learns a query–workflow utility predictor that selects one portfolio member under a performance–cost trade-off, including a dynamic generation option when useful. Across five benchmarks, FlowBank achieves the highest average score among the evaluated methods while remaining cost-competitive, improving over the strongest automated and handcrafted baselines by 3.00 and 9.53 percentage points, respectively. Our code is available at https://agentic-flowbank.github.io/.