Procedural similarity—finding functions that solve problems the same way—is a powerful but overlooked retrieval signal for code generation that works better than traditional lexical or semantic matching alone.
ProjAgent improves repository-level code generation by retrieving functions with similar procedural logic, not just similar keywords or structure. It breaks down target functions into reasoning steps, finds repository functions that follow similar procedures, and combines this with semantic search and compiler feedback to generate better code.