Using the Arc Memory SDK
Learn how to use the Arc Memory SDK to build and query knowledge graphs
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
Check Python Version
Arc Memory requires Python 3.10 or higher and is compatible with Python 3.10, 3.11, and 3.12.
Install the SDK
Authenticate (Optional)
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:
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.