SuperAPI AI Directory

Code Researcher - A Deep Research Agent Tool Launched by Microsoft Research

Author: AI小集 · Original source: AI工具集

What Is Code Researcher

Code Researcher is a deep research agent tool launched by Microsoft Research, specifically designed to handle large system codebases and their commit histories, and to automate the repair of system code crash issues. It works through three stages: Analysis, Synthesis, and Validation. In the Analysis stage, Code Researcher uses a multi-step reasoning strategy, combining code semantics, patterns, and commit history information to collect context and store it in structured memory. The Synthesis stage generates repair patches based on the collected context, and the Validation stage verifies the effectiveness of the patches through external tools.

It can deeply explore codebases and commit histories, and mine global context information related to crashes. It supports multiple reasoning strategies, such as control flow and data flow analysis, pattern search, and causal analysis based on historical commits, and efficiently locates the root cause of problems by searching codebases and commit histories with regular expressions.

Code Researcher

Code Researcher's Main Features

  • Deep Code Analysis: Code Researcher can, through multi-step reasoning, combine code semantics, patterns, and commit histories to gradually collect context information and comprehensively understand the root cause of crashes.
  • Context Collection: It stores information collected during the analysis process through structured memory, ensuring sufficient background information support when generating repair patches.
  • Code Search: It supports searching for specific patterns in codebases through regular expressions, quickly locating relevant code snippets.
  • Commit History Analysis: It can search historical commit records, find changes related to the current crash, and assist repairs based on past development experience.
  • Causal Analysis: It analyzes the impact of historical commits on the current problem and identifies the root cause that introduced the problem.
  • Intelligent Synthesis: Based on the collected context information, it generates repair patches for crash issues. It can identify code snippets to modify across multiple files and generate high-quality repair solutions.
  • Filtering and Optimization: In the synthesis stage, Code Researcher filters out irrelevant information and focuses on context directly related to crash repair, ensuring that the generated patches are accurate and effective.
  • External Tool Integration: It uses external tools to verify whether the generated patches can effectively prevent crashes, ensuring the accuracy and safety of repairs.
  • Automated Validation Process: It verifies the effectiveness of patches through automated testing, reducing manual intervention and improving repair efficiency.
  • Generalization Ability: Code Researcher is suitable for large system code such as the Linux kernel, and can quickly adapt in other system codebases (such as FFmpeg) and generate effective repair patches, demonstrating good generalization ability.
  • Provides Repair Suggestions: In some complex situations where the problem cannot be completely fixed, Code Researcher can provide valuable debugging information and repair suggestions to accelerate problem resolution.

Code Researcher's Technical Principles

  • Multi-Step Reasoning and Semantic Analysis: Code Researcher gradually collects semantic information, patterns, and commit history context of code through multi-step reasoning. Based on the semantic analysis capabilities of large language models (LLMs), it deeply understands code logic and structure, and more accurately locates the root cause of crashes.
  • Code Commit History Analysis: Innovatively mines code commit history, analyzing the evolution trajectory of vulnerabilities during the development process to understand the essence of the problem. This temporal analysis method enables handling ultra-large-scale codebases at the million-line level.
  • Global Context Collection: During the analysis phase, Code Researcher collects global context information, including code snippets, past commit records, and symbol definitions, etc. It is stored in structured memory for subsequent patch generation.
  • Deep Exploration and Intelligent Synthesis: Code Researcher can deeply explore the codebase, with an average of 10 related files explored per trajectory. In the synthesis phase, irrelevant information is filtered out, and repair patches are generated based on the collected context.

Code Researcher project address

Code Researcher application scenarios

  • Linux kernel crash repair: By deeply analyzing the code's semantics, patterns, and commit history, Code Researcher can automatically locate the root cause of crashes and generate repair patches.
  • Enterprise-level software maintenance: Code Researcher can automatically handle crash issues in enterprise-level software, quickly generating repair patches by deeply researching the codebase and commit history.
  • Developer assistance tools: Code Researcher can serve as a developer assistance tool, providing root cause analysis of crashes and repair suggestions.
  • Automated testing and continuous integration: Code Researcher can be integrated into automated testing and continuous integration environments to automatically detect and repair crash issues.