Data Models API
The Data Models API defines the core data structures used in Arc Memory, including nodes, edges, and build manifests.Overview
Arc Memory uses a graph-based data model, where nodes represent entities (commits, files, PRs, issues, ADRs) and edges represent relationships between them. The data models are implemented using Pydantic, which provides validation, serialization, and documentation.Node Types
NodeType
Enum
COMMIT
: A Git commitFILE
: A file in the repositoryPR
: A GitHub Pull RequestISSUE
: A GitHub IssueADR
: An Architectural Decision Record
Node
Base Class
id
: A unique identifier for the nodetype
: The type of the node (fromNodeType
enum)title
: The title or name of the nodebody
: The body or content of the nodets
: The timestamp of the nodeextra
: Additional metadata for the node
Specialized Node Classes
FileNode
path
: The path to the file, relative to the repository rootlanguage
: The programming language of the filelast_modified
: The last modification time of the file
CommitNode
author
: The author of the commitfiles
: The files modified in the commitsha
: The SHA hash of the commit
PRNode
number
: The PR numberstate
: The state of the PR (open, closed, merged)merged_at
: When the PR was mergedmerged_by
: Who merged the PRmerged_commit_sha
: The SHA of the merge commiturl
: The URL of the PR
IssueNode
number
: The issue numberstate
: The state of the issue (open, closed)closed_at
: When the issue was closedlabels
: The labels on the issueurl
: The URL of the issue
ADRNode
status
: The status of the ADR (proposed, accepted, rejected, etc.)decision_makers
: The people who made the decisionpath
: The path to the ADR file
Edge Types
EdgeRel
Enum
MODIFIES
: A commit modifies a fileMERGES
: A PR merges a commitMENTIONS
: A PR or issue mentions another entityDECIDES
: An ADR makes a decision about a file or commit
Edge
Class
src
: The ID of the source nodedst
: The ID of the destination noderel
: The relationship type (fromEdgeRel
enum)properties
: Additional properties of the edge
Build Manifest
BuildManifest
Class
schema
: The schema version of the build manifestbuild_time
: When the build was performedcommit
: The commit hash at the time of the buildnode_count
: The number of nodes in the graphedge_count
: The number of edges in the graphlast_processed
: Metadata from each plugin, used for incremental builds
Search Result
SearchResult
Class
id
: The ID of the nodetype
: The type of the nodetitle
: The title of the nodesnippet
: A snippet of the node’s contentscore
: The relevance score of the result