LocAgent  by gersteinlab

Agentic framework for code localization (research paper)

Created 6 months ago
508 stars

Top 61.4% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

LocAgent is a framework designed for code localization, enabling Large Language Model (LLM) agents to efficiently find relevant code entities within large codebases. It targets developers and researchers working on software engineering tasks that require precise code navigation and understanding, offering improved accuracy through graph-based reasoning.

How It Works

LocAgent parses codebases into directed heterogeneous graphs, creating a lightweight representation that captures code structures and dependencies. This graph representation allows LLM agents to perform multi-hop reasoning, facilitating more effective searching and localization of code elements. The approach leverages graph traversal and LLM capabilities to navigate complex code relationships.

Quick Start & Requirements

  • Install: Clone the repository, create a Conda environment (conda create -n locagent python=3.12), activate it (conda activate locagent), and install dependencies (pip install -r requirements.txt).
  • Prerequisites: Python 3.12, Conda.
  • Launch: Use scripts/run_lite.sh for localization, which requires specifying a dataset (e.g., czlll/SWE-bench_Lite), model (e.g., azure/gpt-4o), and output folder. Batch graph indexing can be performed with python dependency_graph/batch_build_graph.py.
  • Docs: Paper, Loc-bench, Overview.

Highlighted Details

  • Leverages graph-guided LLM agents for code localization.
  • Supports multi-hop reasoning over code structures and dependencies.
  • Integrates with LLM models supporting function calling or code execution.
  • Evaluates results using provided metrics and notebooks.

Maintenance & Community

The project is associated with the gersteinlab. Further community or maintenance details are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The framework's performance may depend on the LLM used and its function-calling capabilities. The README mentions simplified function descriptions for certain LLMs, implying potential limitations with specific models or configurations.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
20 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.