|
1 | | -# Agentic Code Search OSS |
| 1 | +# CodeScout |
2 | 2 |
|
3 | 3 | An open-source implementation of a low-latency agent for code localization. |
4 | | - |
5 | | -- **Repository:** `https://github.com/All-Hands-AI/agentic-code-search-oss` |
6 | | -- **Slack:** `#agentic-code-search-oss` (All-Hands-AI workspace) |
7 | | - |
8 | | -## 1. Problem Statement |
9 | | - |
10 | | -LLM-based coding agents are bottlenecked by context retrieval. They are often slow and inefficient at finding the correct files and code snippets to edit in a large repository. This project builds a small, fast, specialized agent to solve the **code localization** problem. |
11 | | - |
12 | | -## 2. Objective |
13 | | - |
14 | | -The primary goal is to **minimize the latency of code localization**. The secondary goal is to maintain high precision. |
15 | | - |
16 | | -Success will be measured by: |
17 | | - |
18 | | -- **Latency:** Time to identify target code locations. |
19 | | -- **Precision:** Percentage of identified locations that are correct. |
20 | | -- **Recall:** Percentage of all correct locations that were identified. |
21 | | - |
22 | | -## 3. Technical Plan |
23 | | - |
24 | | -The approach is to train a small language model using Reinforcement Learning (RL) on a standardized benchmark. |
25 | | - |
26 | | -1. **Benchmark Environment:** `SWE-Gym` will be used for training and evaluation, as it provides realistic software engineering tasks with executable environments. |
27 | | - |
28 | | -2. **Reward Signal:** The evaluation logic from the `Agentless` project will be used as the "verifiable reward" mechanism. The agent is rewarded for correctly identifying the files and lines that require edits. |
29 | | - |
30 | | -3. **RL Framework:** The agent will be trained using an RL framework. `SkyRL` and `AReaL` are the primary candidates. |
31 | | - |
32 | | -4. **Model:** A small, efficient language model (e.g., `Qwen3-0.6B`) will be fine-tuned for the localization task to ensure low inference latency. |
33 | | - |
34 | | -5. **Tooling Strategy:** The agent will use a set of tools to navigate the codebase. The focus is on: |
35 | | - - **Diverse Tool Calls:** Implementing and evaluating tools beyond `grep`, such as Abstract Syntax Tree (AST) parsers for structural code analysis. |
36 | | - - **Parallel Tool Calling:** Architecting the agent to execute multiple search queries simultaneously to reduce the number of sequential steps. |
37 | | - |
38 | | -## 4. Workstreams & Next Steps |
39 | | - |
40 | | -The project is broken down into the following workstreams: |
41 | | - |
42 | | -- **Workstream 1: Evaluation & RL Environment** |
43 | | - |
44 | | - - **Task:** Set up the core training environment by integrating the `Agentless` validator with `SWE-Gym`. This will provide the foundation for an RL training loop. |
45 | | - |
46 | | -- **Workstream 2: Tooling** |
47 | | - |
48 | | - - **Task:** Research, implement, and evaluate different tool calls (e.g., AST-based search, advanced regex, semantic search). |
49 | | - - **Task:** Design and implement an architecture that supports parallel execution of these tools. |
50 | | - |
51 | | -- **Workstream 3: Reinforcement Learning** |
52 | | - |
53 | | - - **Task:** Implement and run training loops using a selected RL framework (e.g., `SkyRL`, `AReaL`). |
54 | | - - **Task:** Experiment with reward shaping and policy optimization to improve agent performance. |
55 | | - |
56 | | -- **Future Considerations:** |
57 | | - - Investigating question-answering tasks using datasets like `CodeSearchNet`. |
58 | | - - Analyzing successful agent trajectories to improve learning. |
59 | | - |
60 | | -## 5. Contribution |
61 | | - |
62 | | -This is a community-driven project. |
63 | | - |
64 | | -1. Join the `#agentic-code-search-oss` channel on the All-Hands-AI Slack. |
65 | | -2. Check the GitHub Issues for open tasks. |
66 | | -3. Attend the weekly meetings to sync on progress (details in the Slack channel). |
67 | | - |
68 | | -## 6. Resources |
69 | | - |
70 | | -- **Primary Inspiration:** [Cognition AI's SWE-grep Blog Post](https://cognition.ai/blog/swe-grep) |
71 | | -- **Core Components:** |
72 | | - - [SWE-Gym (Environment)](https://github.com/SWE-Gym/SWE-Gym) |
73 | | - - [Agentless (Reward Validator)](https://github.com/OpenAutoCoder/Agentless) |
74 | | - - [SkyRL (RL Framework)](https://github.com/NovaSky-AI/SkyRL) |
75 | | - - [AReaL (RL Framework)](https://github.com/inclusionAI/AReaL) |
76 | | -- **Relevant Research & Projects:** |
77 | | - - [NVIDIA Nemotron-CORTEXA](https://github.com/NVIDIA/Nemotron-CORTEXA) |
78 | | - - [LocAgent: Graph-Guided LLM Agents](https://arxiv.org/abs/2503.09089) |
79 | | - - [SWE-Fixer: Open-Source LLMs for Issue Resolution](https://arxiv.org/abs/2501.05040) |
80 | | -- **Datasets:** |
81 | | - - [CodeSearchNet](https://github.com/github/CodeSearchNet) |
82 | | - - [SWE-Fixer-Train-110K](https://huggingface.co/datasets/internlm/SWE-Fixer-Train-110K) |
83 | | -- **Training Parallel Tool Calling:** |
84 | | - - [SWE-Grep](https://cognition.ai/blog/swe-grep): Forcing parallel tool calling during training (8 tools in parallel per step) |
85 | | - - [LLMCompiler](https://arxiv.org/abs/2405.17438): Using a "compiler" idea to orchestrate parallel tool calling during training; could be an overall kill for just searching tasks. |
86 | | - - [Divide-Then-Aggregate](https://aclanthology.org/2025.acl-long.1401.pdf): Another similar training method for parallel tool calling. |
87 | | - - [KAT](https://skywork.ai/blog/kat-models-parallel-tool-calling-ai-coding-agents/): Some good practices for parallel tool calling. |
88 | | - - Overall, this space is relatively unexplored. |
89 | | - - Finally, this parallel tool calling thing is related to the idea of "multi-agent" framework: |
90 | | - - [M1-Parallel](https://arxiv.org/abs/2507.08944): runs multiple multi-agent teams in parallel |
91 | | - - [ToolFlow](https://arxiv.org/abs/2410.18447): multiple agents to synthesize the training data |
92 | | - |
0 commit comments