GithubHelp home page GithubHelp logo

blarapp / code-base-agent Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 7.0 997 KB

Code agents for LLMs

Home Page: https://blar.io

License: MIT License

Python 3.82% Jupyter Notebook 96.16% Makefile 0.02%
agents knowledge-graph llama-index llm neo4j

code-base-agent's People

Contributors

berrazuriz1 avatar josem7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nashid

code-base-agent's Issues

Evaluate performance against SWE-Bench

It would be interesting to see if/how blar performs against the SWE-Bench benchmarks:

  • https://www.swebench.com/
  • https://github.com/princeton-nlp/SWE-bench
    • [ICLR 2024] SWE-Bench: Can Language Models Resolve Real-world Github Issues?

  • https://arxiv.org/abs/2310.06770
    • SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
      Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan
      Language models have outpaced our ability to evaluate them effectively, but for their future development it is essential to study the frontier of their capabilities. We consider real-world software engineering to be a rich, sustainable, and challenging testbed for evaluating the next generation of language models. We therefore introduce SWE-bench, an evaluation framework including 2,294 software engineering problems drawn from real GitHub issues and corresponding pull requests across 12 popular Python repositories. Given a codebase along with a description of an issue to be resolved, a language model is tasked with editing the codebase to address the issue. Resolving issues in SWE-bench frequently requires understanding and coordinating changes across multiple functions, classes, and even files simultaneously, calling for models to interact with execution environments, process extremely long contexts and perform complex reasoning that goes far beyond traditional code generation. Our evaluations show that both state-of-the-art proprietary models and our fine-tuned model SWE-Llama can resolve only the simplest issues. Claude 2 and GPT-4 solve a mere 4.8% and 1.7% of instances respectively, even when provided with an oracle retriever. Advances on SWE-bench represent steps towards LMs that are more practical, intelligent, and autonomous.

TypeError: unhashable type: 'list'

Describe the bug
The code fails when trying to create the graph of the pvlib repo

Trace

Traceback (most recent call last):
  File "//build_graph.py", line 16, in <module>
    build_graph(repo_name)
  File "//build_graph.py", line 12, in build_graph
    graph_constructor.build_graph(repo_name)
  File "/root/miniconda3/lib/python3.9/site-packages/blar_graph/graph_construction/core/graph_builder.py", line 264, in build_graph
    relationships.extend(self._relate_imports(imports))
  File "/root/miniconda3/lib/python3.9/site-packages/blar_graph/graph_construction/core/graph_builder.py", line 148, in _relate_imports
    targetId = self.global_imports.get(import_alias)
TypeError: unhashable type: 'list'

To Reproduce
Steps to reproduce the behavior:

  1. clone the pvlib-python repo
  2. build graph on pvlib directory

Expected behavior
Get the correct graph

Screenshots

Screenshot from 2024-04-10 14-16-58

Desktop (please complete the following information):

  • Ubuntu 22.04.4 LTS

Error when running run.py

Describe the bug
When trying to create a graph of the code-base-agent repo by running the run.py with graph_constructor.build_graph("src") it throws the following error when processing
code-base-agent/src/blar_graph/db_managers/init.py

Traceback (most recent call last):
  File "/home/jose/Desktop/Trabajo/blar/code-base-agent/src/blar_graph/graph_construction/core/graph_builder.py", line 59, in _scan_directory
    processed_nodes, relations, file_imports = self.parser.parse_file(
  File "/home/jose/Desktop/Trabajo/blar/code-base-agent/src/blar_graph/graph_construction/languages/python/python_parser.py", line 76, in parse_file
    return [], [], self.parse_init(file_path, root_path)
  File "/home/jose/Desktop/Trabajo/blar/code-base-agent/src/blar_graph/graph_construction/languages/python/python_parser.py", line 97, in parse_init
    new_import_path = import_path + "." + import_statement.text.decode()
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

To Reproduce
Steps to reproduce the behavior:

  1. clone the repo git clone https://github.com/blarApp/code-base-agent.git
  2. run the run.py file

Explore whether stack graphs may be useful in this tool

Not really a feature request per se, but came across this project after it was mentioned in another issue (Ref), and figured I would create an issue to share the same info here in case it's useful.

I notice that you're already using tree-sitter, so it may not be a lot of extra effort to make use of tree-sitter-graph and/or the stack-graphs project (eg. tree-sitter-stack-graphs-javascript, etc)

From watching the demo video on linkedin + briefly skimming this repo, it looks like there might be some useful crossovers, and it may allow you to add support for a whole bunch more languages without needing to re-invent the wheel to do so.

A few notes/links/references I recently collated RE: stack graphs + related libs:

Stack Graphs (an evolution of Scope Graphs) sound like they could be really interesting/useful with regards to code navigation, symbol mapping, etc. Perhaps we could use them for module identification, or variable/function identifier naming stabilisation or similar?

  • https://github.blog/changelog/2024-03-14-precise-code-navigation-for-typescript-projects/
    • Precise code navigation is now available for all TypeScript repositories.
      Precise code navigation gives more accurate results by only considering the set of classes, functions, and imported definitions that are visible at a given point in your code.

      Precise code navigation is powered by the stack graphs framework.
      You can read about how we use stack graphs for code navigation and visit the stack graphs definition for TypeScript to learn more.

      • https://github.blog/2021-12-09-introducing-stack-graphs/
        • Introducing stack graphs

        • Precise code navigation is powered by stack graphs, a new open source framework we’ve created that lets you define the name binding rules for a programming language using a declarative, domain-specific language (DSL). With stack graphs, we can generate code navigation data for a repository without requiring any configuration from the repository owner, and without tapping into a build process or other CI job.

        • LOTS of interesting stuff in this post..
        • As part of developing stack graphs, we’ve added a new graph construction language to Tree-sitter, which lets you construct arbitrary graph structures (including but not limited to stack graphs) from parsed CSTs. You use stanzas to define the gadget of graph nodes and edges that should be created for each occurrence of a Tree-sitter query, and how the newly created nodes and edges should connect to graph content that you’ve already created elsewhere.

        • Why aren’t we using the Language Server Protocol (LSP) or Language Server Index Format (LSIF)?

          To dig even deeper and learn more, I encourage you to check out my Strange Loop talk and the stack-graphs crate: our open source Rust implementation of these ideas.

  • https://docs.github.com/en/repositories/working-with-files/using-files/navigating-code-on-github
    • GitHub has developed two code navigation approaches based on the open source tree-sitter and stack-graphs library:

      • Search-based - searches all definitions and references across a repository to find entities with a given name
      • Precise - resolves definitions and references based on the set of classes, functions, and imported definitions at a given point in your code

      To learn more about these approaches, see "Precise and search-based navigation."

      • https://docs.github.com/en/repositories/working-with-files/using-files/navigating-code-on-github#precise-and-search-based-navigation
        • Precise and search-based navigation
          Certain languages supported by GitHub have access to precise code navigation, which uses an algorithm (based on the open source stack-graphs library) that resolves definitions and references based on the set of classes, functions, and imported definitions that are visible at any given point in your code. Other languages use search-based code navigation, which searches all definitions and references across a repository to find entities with a given name. Both strategies are effective at finding results and both make sure to avoid inappropriate results such as comments, but precise code navigation can give more accurate results, especially when a repository contains multiple methods or functions with the same name.

  • https://pl.ewi.tudelft.nl/research/projects/scope-graphs/
    • Scope Graphs | A Theory of Name Resolution

    • Scope graphs provide a new approach to defining the name binding rules of programming languages. A scope graph represents the name binding facts of a program using the basic concepts of declarations and reference associated with scopes that are connected by edges. Name resolution is defined by searching for paths from references to declarations in a scope graph. Scope graph diagrams provide an illuminating visual notation for explaining the bindings in programs.

Originally posted by @0xdevalias in 0xdevalias/chatgpt-source-watch#11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.