AgSpec combines session and workspace corpora with adaptive draft length to lift coding-agent generation throughput to 4.37x over autoregressive decoding
AgSpec is a retrieval-based speculative decoding framework for coding-agent pipelines that organizes reusable text into session, workspace, and global corpora by source, indexes workspace files in the agent's emission format, and controls draft length with offline-profiled per-agent caps plus an online scale adapted from verification feedback; on the two repository-level multi-agent benchmarks SWE-bench Verified and TeamBench it outperforms five retrieval-based drafters and EAGLE-3 in most evaluated settings, raising generation throughput over autoregressive decoding up to 4.37x at batch size 1 and 4.76x at batch size 16, and it remains effective on benchmarks without a repository or a multi-agent pipeline.