Transform your codebase into a powerful, queryable knowledge graph!
Code-to-Knowledge-Graph is a Kotlin/JVM toolkit that parses source code and creates rich, queryable knowledge graphs using VS Code's Language Server Protocol (LSP). Extract entities, relationships, and architecture insights from any codebase.
🔍 Understand Code Structure • 📈 Analyze Impact • 🏛️ Gain Architectural Insights • 🛠️ Build Custom Tools • 🤖 Augment AI & LLMs
- Install Bevel Extension from VS Code marketplace
- Open your codebase and run
Bevel: Re-/Analyze Project - Explore with additional tools:
- Bevel Neo4j Visualization for graph exploration
- Bevel Test Generator for AI-assisted testing
Gradle:
dependencies {
implementation("software.bevel:code-to-knowledge-graph:1.1.3")
}Basic Usage:
import software.bevel.code_to_knowledge_graph.FactoriesKt;
String projectPath = "/path/to/your/project";
Parser parser = FactoriesKt.createVsCodeParser(projectPath);
Graphlike graph = parser.parse(List.of(projectPath));
System.out.println("Nodes: " + graph.getNodes().size());
System.out.println("Connections: " + graph.getConnections().getAllConnections().size());Transform your knowledge graph into powerful developer tools:
Bevel Neo4j Visualization - Explore your codebase visually
Bevel Test Generator - Generate comprehensive test prompts
Bevel Extension - Generate interactive diagrams
Build your own analysis tools using the knowledge graph API
- 🎯 VS Code LSP Integration: Leverages VS Code's language servers for robust, multi-language parsing
- 📊 Rich Graph Model: Comprehensive representation of code entities and relationships
- 🔄 Incremental Updates: Support for real-time graph updates based on file changes
- 📁 Smart File Discovery: Respects
.gitignorepatterns and project structures - 🔗 Similarity Detection: MinHashing for code similarity analysis
- 🏗️ Extensible Architecture: Build custom analysis tools on top of the graph
Contributions are welcome! Whether it's bug fixes, feature enhancements, or improvements to documentation, your help is appreciated.
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes. Adhere to Kotlin coding conventions.
- Add tests for any new functionality or bug fixes. Ensure all tests pass:
./gradlew test. - Commit your changes with clear, descriptive messages.
- Push to your branch.
- Open a Pull Request against the
mainbranch of the original repository.
Please ensure your PR description clearly explains the changes and their motivations.
Mozilla Public License Version 2.0 - see LICENSE for details.
Unlock the hidden structure within your codebase! 🚀
