Building graphs
Building Knowledge Graphs
This guide provides examples of how to build knowledge graphs with Arc Memory for different scenarios.
Related Documentation:
- Authentication Commands - Authenticate with GitHub
- Build Commands - Reference for build commands
- Doctor Commands - Verify your build status
- Build API - Programmatic access to build functionality
Basic Graph Building
The simplest way to build a knowledge graph is to run the arc build
command in your repository:
This will:
- Scan your Git repository for commits
- Fetch GitHub PRs and issues (if authenticated)
- Find ADRs in your repository
- Build a knowledge graph in
~/.arc/graph.db
Incremental Builds
For faster updates after the initial build, use incremental builds:
Incremental builds are much faster because they only process data that has changed since the last build. This is especially useful for large repositories or daily updates.
Limiting the Build Scope
For large repositories, you may want to limit the scope of the build:
Custom Output Location
By default, Arc Memory stores the knowledge graph in ~/.arc/graph.db
. You can specify a custom location:
This is useful for:
- Storing graphs for different projects separately
- Sharing graphs with team members
- Backing up graphs
Building with GitHub Authentication
To include GitHub PRs and issues in your graph, authenticate with GitHub first:
You can also provide a token directly:
Building for a Specific Repository
By default, Arc Memory builds the graph for the current directory. You can specify a different repository:
CI/CD Integration
For team-wide graph updates, you can integrate Arc Memory into your CI/CD pipeline:
Monitoring Build Progress
The build process shows progress for each plugin:
For more detailed logs, use the --debug
flag:
Verifying the Build
After building, you can verify the graph with the doctor command:
This will show statistics about your knowledge graph, including the number of nodes and edges.
Troubleshooting Common Issues
GitHub Rate Limiting
If you hit GitHub API rate limits:
Large Repositories
For very large repositories:
Missing Data
If data is missing from your graph:
- Ensure you’re authenticated with GitHub:
arc auth gh
- Check that your repository has the expected structure
- Run a full build:
arc build
(without--incremental
) - Verify with
arc doctor