ADR 001 Incremental Builds
ADR-001: Incremental Build Strategy
Status: Accepted
Date: 2025-04-25
Decision makers: Jarrod Barnes (Founder), Core Eng Team
Context: Arc Memory needs an efficient strategy for keeping the knowledge graph up-to-date without requiring full rebuilds. This ADR outlines the incremental build approach and CI integration.
1 · Problem Statement
The Arc Memory knowledge graph needs to stay current with repository changes, but rebuilding the entire graph for each update is inefficient and may hit GitHub API rate limits. We need a strategy that:
- Minimizes GitHub API calls
- Reduces build time for frequent updates
- Integrates with CI/CD for team-wide graph updates
- Maintains extensibility for future data sources
2 · Incremental Build Design
2.1 Build Manifest
The build.json
manifest will be extended to include:
2.2 Incremental Processing Logic
Git Commits
- Use
git log <last_commit_hash>..HEAD
to get only new commits - Process only these new commits and their associated files
GitHub API Calls
- Use GitHub’s
since
parameter in API calls to fetch only PRs/issues updated after last build - For issues, use
/issues?since=<last_build_timestamp>
- For PRs, use
/pulls?state=all&sort=updated&direction=desc
and filter by update time
ADR Processing
- Track file modification times of ADRs
- Only reprocess ADRs that have been modified since last build
Database Updates
- Use SQLite transactions for atomic updates
- Add new nodes and edges without rebuilding the entire graph
- Update existing nodes if they’ve changed (e.g., PR status changed from open to merged)
3 · CI Integration
3.1 GitHub Actions Workflow
3.2 Developer Workflow
-
Initial setup:
-
Regular updates:
4 · Extensibility for Future Integrations
4.1 Plugin Architecture
We will implement a plugin architecture for ingestors:
This will allow for easy addition of new data sources like GitLab, Jira, etc.
4.2 Schema Versioning
We will include schema version in the database and implement migration paths for schema updates:
5 · Decision
We will adopt the incremental build strategy with CI integration as described above. This approach balances efficiency with extensibility while maintaining the local-first philosophy of Arc Memory.
Accepted – 2025-04-25
— Jarrod Barnes
6 · Implementation Checklist
- Extend
build.json
manifest schema - Implement
--incremental
flag inarc build
command - Add incremental processing logic for Git data
- Add incremental processing logic for GitHub data
- Add incremental processing logic for ADRs
- Implement schema version checking
- Create GitHub Actions workflow template
- Implement
--pull
flag to fetch CI-built graphs - Create plugin architecture for ingestors
- Implement database migrations