FlowBank: Query-Adaptive Agentic Workflows Optimization through Precompute-and-Reuse

Lingzhi Yuan, Chenghao Deng, Fangxu Yu, Souradip Chakraborty, Mohammad Rostami, Furong Huang

TL;DR

FlowBank introduces a "precompute-and-reuse" paradigm for optimizing LLM multi-agent workflows, bridging the gap between rigid, single-workflow methods and expensive, per-query generation. By building a compact offline portfolio of complementary workflows and using a lightweight graph neural network to route queries at runtime, it achieves state-of-the-art performance across five benchmarks while remaining highly cost-effective.

What Problem Does This Paper Address?

When building Large Language Model (LLM)-based multi-agent systems, designing the right workflow—the graph of LLM calls, prompts, and routing logic—is crucial. Current automated optimization approaches fall into two extreme camps:

  1. Task-level optimization: Spends heavy compute offline to find one "universally best" static workflow. This is cheap at inference time but suffers from a "one-size-fits-all" limitation, failing to adapt to diverse queries.
  2. Query-level optimization: Dynamically generates a custom workflow on the fly for every single incoming query. While highly adaptive, this incurs massive inference latency and token costs.

The authors identify an unexploited middle ground: workflows discarded during offline searches often excel at different subsets of queries, and many queries routed to expensive dynamic generators could be solved just as well by cheaper, precomputed static workflows. FlowBank aims to build a compact bank of reusable, complementary workflows and select among them adaptively at inference time.

Methods

FlowBank addresses this challenge with a three-stage framework:

  1. Diversifying (DiverseFlow): Instead of searching for a single top-performing workflow, it uses a two-phase Monte Carlo Tree Search (MCTS). After an initial performance-oriented warm-up, it switches to a complementarity-oriented expansion phase, re-weighting the search to discover workflows that specifically solve queries left unanswered by the current pool.
  2. Curating (CuraFlow): To avoid deployment bloat, this stage filters the candidate pool into a compact portfolio. It treats this as a submodular optimization problem, finding the minimum subset of workflows that preserves the maximum possible query coverage.
  3. Matching: At inference time, routing is modeled as an edge-value prediction problem on a query-workflow bipartite graph. A lightweight 2-layer Heterogeneous Graph Neural Network (GNN) predicts the utility (balancing accuracy and token cost) of each portfolio member for a new query, executing only the highest-scoring workflow.
Overview of the FlowBank framework

Datasets

The framework was evaluated across five public benchmarks spanning four distinct domains:

  • MATH & AMC (Mathematical reasoning)
  • MBPP (Code generation)
  • MMLU Pro (Multi-task question answering)
  • DROP (Reading comprehension with discrete reasoning)

The benchmarks were split into a 1:4 ratio for training (workflow optimization/selector training) and testing (final evaluation).

Key Insights and Ideas

  • Workflow Complementarity is Real: Discarded workflows from traditional searches aren't useless; they often possess unique strengths on niche query types. Selecting combinatorially distinct workflows yields significantly higher coverage than simply picking the top-$k$ highest-accuracy ones.
  • Decoupling Generation from Routing: You don't need to generate a new workflow on the fly to get query-level adaptivity. Precomputing a diverse set offline and using a cheap graph-based router online recovers the benefits of query-level methods at a fraction of the cost.
  • Graph-Based Routing Handles Ties Naturally: By framing selection as edge-value prediction on a bipartite graph rather than a flat multi-class classification problem, the router naturally handles scenarios where multiple workflows perform equally well, breaking ties based on token cost.
Figure 2: Coverage on MATH for workflow sets built from AFlow candidates.

Key Results

  • State-of-the-Art Performance: FlowBank achieved the highest average performance score (73.40) across all five benchmarks, outperforming the strongest automated baseline (AFlow using GPT-4o) by 3.00 absolute points (4.26% relative improvement), despite FlowBank using a smaller model (Qwen3-8B) as its offline optimizer.
  • Pareto Efficiency: FlowBank sits firmly on the performance-cost Pareto frontier. It achieved an average inference cost below both AFlow (GPT-4o) and ScoreFlow, proving that smart routing reduces redundant token consumption.
  • Ablation Validation: Removing any of the three components (DiverseFlow, CuraFlow, or the GNN matcher) led to a noticeable drop in performance, confirming that candidate diversity, portfolio curation, and graph-based matching are tightly coupled requirements.
Figure 1: FlowBank turns workflows from one-shot solutions into reusable assets. Left: Rather than committing to a single universal workflow or generating a new workflow for every query, FlowBank builds a compact portfolio of complementary workflows offline and assigns each query to the member with the best predicted utility. Right: This portfolio view recovers query-level adaptivity without the full per-query generation cost, yielding a stronger performance–cost trade-off across five benchmarks. (The plotted cost axis is inverted so that higher values correspond to lower actual cost.)

Limitations and Future Work

  • Static Portfolio: Once the curation phase is complete, the portfolio is fixed. Workflows discovered later cannot be dynamically integrated without re-running the curation and matching training phases.
  • Hyperparameter Tuning: The framework relies on two key hyperparameters—the saturation ratio $\tau$ (for portfolio sizing) and the cost trade-off weight $\lambda$. While robust, fully automating their selection remains an open challenge.
  • Future Direction: The authors suggest evolving FlowBank into a continually expanding, memory-based flow library that dynamically learns from execution successes and failures over time.

Summary updated

BibTeX
@inproceedings{yuan2026flowbank,
  author = {Lingzhi Yuan and Chenghao Deng and Fangxu Yu and Souradip Chakraborty and Mohammad Rostami and Furong Huang},
  title = {{FlowBank: Query-Adaptive Agentic Workflows Optimization through Precompute-and-Reuse}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Nx2TulAMl6},
}
Figure