This library is used to create a knowledge graph from a python project.
It is based on the modelscope_agent/environment/graph_database package from the ModelScope-Agent project,
but ported to be used as a standalone packaged CLI interface.
- Neo4j DBMS (local or remote). We recommend using the Neo4j Desktop application due to its better performance.
- uv tool to manage python virtual environment and dependencies.
Clone the repository and set the environment variables in a .env:
cp .env.example .envSet your Neo4j connection details in the .env file:
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_passwordCreate environment and install dependencies:
uv syncCreate a knowledge graph for a single Python project.
uv run pykagcee build /path/to/single/projectCreate knowledge graphs for multiple Python projects under a directory.
uv run pykagcee build-all /path/to/multiple/projects --max-workers 8Clean all databases.
uv run pykagcee wipeThis project includes modifications made by Perer876:
- 01/07/2025: Extract the
graph_databasepackage from theModelScope-Agentproject and add it to this project. - 30/08/2025: Several changes to support the CLI interface and multiple graph creation.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
This project is based on the ModelScope Agent project by Alibaba ModelScope. See the NOTICE file for details.