Using the Arc Memory SDK
The Arc Memory SDK provides a powerful interface for building and querying knowledge graphs from your codebase. It embeds a local, bi-temporal knowledge graph (TKG) in your workspace, surfacing verifiable decision trails during code review and exposing the same provenance to LLM-powered agents.Installation and Setup
1
Check Python Version
Arc Memory requires Python 3.10 or higher and is compatible with Python 3.10, 3.11, and 3.12.
2
Install the SDK
3
Authenticate (Optional)
4
Import and Initialize
Common Use Cases
Best Practices
Performance Optimization
- Use incremental builds for faster updates
- Apply specific filters to limit search scope
- Cache results for frequently accessed data
Error Handling
- Always use try/except blocks
- Validate inputs before queries
- Handle rate limits for GitHub operations
Advanced Usage
Custom Queries
Working with Large Codebases
For large codebases, consider these strategies:Incremental Updates
Incremental Updates
Targeted Queries
Targeted Queries
Integration Examples
CI/CD Integration
Automated Code Review
Next Steps
For more detailed examples, check out these resources:Arc Memory is designed for high performance, with trace history queries completing in under 200ms (typically ~100μs). For benchmarking details and performance metrics, visit our GitHub repository.