Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for Guidance on Code Graph Generation Tool Used in FalkorDB #90

Open
programmerraja opened this issue Jun 11, 2024 · 7 comments
Labels
question Further information is requested

Comments

@programmerraja
Copy link

Hello @gkorland

I hope this message finds you well.

I recently came across FalkorDB while researching methods to convert codebases into graph formats. I was impressed by your project and its capabilities. I am very interested in understanding how you generate the code graph used in your repository.

Could you please provide guidance on the tools and methodologies you employed for creating these code graphs? Any insights or recommendations would be greatly appreciated.

Thank you for your time and assistance.

@swilly22 swilly22 added the question Further information is requested label Jun 11, 2024
@swilly22
Copy link
Contributor

Hi @programmerraja, I'm glad to learn you've found this project interesting,
I believe the best way to learn how we've created graphs from source files is to review the source code.

But in broad strokes you should know we're:

  1. Cloning a Github repository (to get the actual source code)
  2. Use tree-sitter to parse source code into AST
  3. Taken action when an AST node of interest is encountered e.g. when a Function AST node is discovered we take the appropriate action to create a Function entity within the graph we're constructing.

Would you mind sharing some details on your project, what it is your trying to achieve?

We're thinking on:

  1. Turning this demo into a library / service one could use to generate "code-graphs"
  2. Support additional programming languages.

@programmerraja
Copy link
Author

@swilly22 Thank you for your response.

Our project is dedicated to the development of a chat bot tailored for assisting users with queries pertaining to our codebase. We envision a platform where users can seamlessly seek clarification and guidance on various aspects of our code.

In pursuit of this objective, we are keen on exploring methods to convert our codebase into graph representations, facilitating easier comprehension and interaction within the chat bot interface. Your project, FalkorDB, has caught our attention due to its commendable capabilities in code graph generation.

We understand the value of open-source collaboration and would greatly appreciate access to your codebase (code to graph) if it is open source. However, if this is not possible, we are prepared to diligently follow the steps outlined in your methodology to develop our own code-to-graph conversion solution.

Thank you once again for your consideration.

@swilly22
Copy link
Contributor

@programmerraja the repository is open for the public, we'll be happy to collaborate.

@programmerraja
Copy link
Author

@swilly22 Thank you for your prompt response and willingness to collaborate.can i know the repo for creating graph from codebase

@swilly22
Copy link
Contributor

For the time being this is the repo.

@programmerraja
Copy link
Author

@swilly22 yep but the code for converting code to graph (parse) is in binary format how can i view the original code of the parser without binary

@swilly22
Copy link
Contributor

This project uses tree-sitter as its parser,
the parser itself is compiled to binary and we're using it as is to create an AST and traverse it while extracting relevant information such as Classes, Functions and Modules.

Although there are multiple options when it comes to parsers e.g. Antler, YACC, LEG/PEG we've decided to go with tree-sitter due to its bindings and richness variety of grammar files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants