Retrieval-Conditioned Topology Selection with Provable Budget Conservation for Multi-Agent Code Generation

Talluri, Abhijit, Anne, Pujith, Pendiyala, Bhagavan Choudary, Chilukuri, Raghavendra

–arXiv.org Artificial Intelligence 

Multi-agent LLM systems for code generation face a fundamental routing problem: the optimal orchestration topology--we distinguish FASTPATH (monolithic), SUBAGENT (single specialist), MULTIAGENT (pipeline or swarm), and DEEPRESEARCH (multi-stage retrieval-heavy)--depends on the structural complexity of the code under modification, yet existing systems select topologies without consulting the codebase. We present Retrieval-Guided Adaptive Orchestration (RGAO), an architecture that closes this loop by extracting a structural complexity vector from a hierarchical code index before selecting the orchestration topology. RGAO operates within CODE-AGENT, a multi-agent framework whose sub-agents are governed by formal I,C,T,M contracts with six-dimensional budget vectors. Our headline contribution is the composition of two previously separate lines of work--complexity-conditioned LLM routing and formal resource algebras-- yielding a property neither admits alone: provable budget conservation under retrieval-conditioned dynamic topology selection. Concretely we contribute: (1) a complexity-conditioned topology router that maps retrieval-derived code-structure signals (dependency depth, cross-module coupling, symbol density) to orchestration decisions, reducing proxy-measured misrouting from 30.1% (95% Wilson CI [26.4,