We present CodeNav, an LLM agent that navigates and leverages previously unseen code repositories to solve user queries. In contrast to tool-use LLM agents that require ``registration'' of all relevant tools via manual descriptions within the LLM context, CodeNav automatically indexes and searches over code blocks in the target codebase, finds relevant code snippets, imports them, and uses them to iteratively generate a solution with execution feedback. To highlight the core-capabilities of CodeNav, we first showcase three case studies where we use CodeNav for solving complex user queries using three diverse codebases. Next, on three benchmarks, we quantitatively compare the effectiveness of code-use (which only has access to the target codebase) to tool-use (which has privileged access to all tool names and descriptions). Finally, we study the effect of varying kinds of tool and library descriptions on code-use performance, as well as investigate the advantage of the agent seeing source code as opposed to natural descriptions of code. All code will be made open source under a permissive license.
翻译:本文提出CodeNav,一种能够导航并利用先前未见代码仓库以解决用户查询的LLM智能体。与需要通过LLM上下文手动描述所有相关工具进行“注册”的工具使用型LLM智能体不同,CodeNav能够自动对目标代码库中的代码块进行索引与检索,定位相关代码片段,将其导入系统,并借助执行反馈迭代生成解决方案。为凸显CodeNav的核心能力,我们首先展示三个案例研究,分别使用三个不同代码库通过CodeNav解决复杂用户查询。随后,我们在三个基准测试中定量比较代码使用(仅能访问目标代码库)与工具使用(拥有所有工具名称和描述的优先访问权)的效果差异。最后,我们探究不同类型工具和库描述对代码使用性能的影响,并分析智能体直接查看源代码相较于阅读代码自然语言描述的优势。所有代码将在宽松许可协议下开源发布。