Prerequisite: Please install Node.js (version 19 or higher) before proceeding.
Ensure you have a codebase ready to index.
Follow these steps to install and run Graptor on your codebase:
Step 1: Install Graptor:
Step 2: Navigate to the codebase folder or specific directory:
graptor run <folder name>
Graptor internally Parses your code with ASTs and Builds a semantic code graph.
At this point, code-graph.json is created. You can stop here if you only need the code graph.
Step 3: Generate vector embeddings:
Do you want to embed these chunks into vectors now? (Y/n)
If you choose Yes, you can select:
- Open-source model (default, no API key needed)
- Your own model (coming soon!)
Graptor then converts each code chunk into a vector embedding and saves the
result in embeddigs.json
Now, These embeddings are ready to use in a vector database or with LLM agents.