arXiv:2508.08322cs.SEcs.AI2025-08被引 9

多智能体协作+上下文增强,提升大模型代码助手在复杂项目中的准确率。

Context Engineering for Multi-Agent LLM Code Assistants Using Elicit, NotebookLM, ChatGPT, and Claude Code

  • 用多个AI组件分步处理需求理解、知识检索与代码生成。
  • 在Next.js项目中实现高成功率单次生成,减少人工干预。
  • 适合需要精准代码生成的工程团队与自动化开发场景。

大语言模型在自动化代码生成和软件工程任务中展现潜力,但在复杂多文件项目中常因上下文限制和知识缺口而表现不佳。本文提出一种新型上下文工程流程,整合多个AI组件:使用GPT-5作为意图翻译器澄清用户需求,Elicit驱动的语义文献检索注入领域知识,NotebookLM实现文档合成以增强上下文理解,Claude Code多智能体系统负责代码生成与验证。该方法结合意图澄清、检索增强生成与专用子智能体,通过Claude的代理框架进行协调。实证表明,该方案显著提升代码助手在真实仓库中的准确性和可靠性,单次生成成功率更高,对项目上下文的遵循度优于基线单智能体方法。在大型Next.js代码库上的定性结果显示,多智能体系统能有效规划、修改并测试复杂功能,几乎无需人工介入。与CodePlan、MASAI、HyperAgent等近期框架对比,凸显了针对性上下文注入与代理角色分解带来的性能优势。最后讨论了在生产环境中部署基于LLM的编码助手的启示,以及上下文管理与未来研究方向。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have shown promise in automating code generation and software engineering tasks, yet they often struggle with complex, multi-file projects due to context limitations and knowledge gaps. We propose a novel context engineering workflow that combines multiple AI components: an Intent Translator (GPT-5) for clarifying user requirements, an Elicit-powered semantic literature retrieval for injecting domain knowledge, NotebookLM-based document synthesis for contextual understanding, and a Claude Code multi-agent system for code generation and validation. Our integrated approach leverages intent clarification, retrieval-augmented generation, and specialized sub-agents orchestrated via Claude's agent framework. We demonstrate that this method significantly improves the accuracy and reliability of code assistants in real-world repositories, yielding higher single-shot success rates and better adherence to project context than baseline single-agent approaches. Qualitative results on a large Next.js codebase show the multi-agent system effectively plans, edits, and tests complex features with minimal human intervention. We compare our system with recent frameworks like CodePlan, MASAI, and HyperAgent, highlighting how targeted context injection and agent role decomposition lead to state-of-the-art performance. Finally, we discuss the implications for deploying LLM-based coding assistants in production, along with lessons learned on context management and future research directions.

代码生成多智能体上下文工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。