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.
# Build a complete knowledge grapharc.build()# Incremental build (faster for subsequent updates)arc.build_incremental()# Build with specific optionsarc.build( max_commits=1000, days=30, include_prs=True, include_issues=True)
Copy
# Build a complete knowledge grapharc.build()# Incremental build (faster for subsequent updates)arc.build_incremental()# Build with specific optionsarc.build( max_commits=1000, days=30, include_prs=True, include_issues=True)
Copy
# Trace history of a specific linehistory = arc.trace_file( file_path="src/main.py", line_number=42, max_hops=3)# Process the resultsfor item in history: print(f"Commit: {item.commit_hash}") print(f"Author: {item.author}") print(f"Message: {item.message}")
Copy
# Find related changes for a commitrelated = arc.trace_commit( commit_hash="abc123...", include_prs=True)# Analyze relationshipsfor node in related.nodes: print(f"Related: {node.type} - {node.id}") print(f"Relationship: {node.relationship}")
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.