Struct MemoryCommit
Source pub struct MemoryCommit {Show 16 fields
pub commit_id: Uuid,
pub trajectory_id: TrajectoryId,
pub scope_id: ScopeId,
pub agent_id: Option<AgentId>,
pub query: String,
pub response: String,
pub mode: String,
pub reasoning_trace: Option<Value>,
pub rag_contributed: bool,
pub artifacts_referenced: Vec<ArtifactId>,
pub notes_referenced: Vec<NoteId>,
pub tools_invoked: Vec<String>,
pub tokens_input: i64,
pub tokens_output: i64,
pub estimated_cost: Option<f64>,
pub created_at: DateTime<Utc>,
}Expand description
Memory commit - versioned record of an interaction. Enables: “Last time we decided X because Y” Every interaction creates a versioned commit for recall, rollback, audit, and rehydration.
Fields§
§commit_id: UuidUnique identifier for this commit
trajectory_id: TrajectoryIdTrajectory this commit belongs to
scope_id: ScopeIdScope this commit belongs to
agent_id: Option<AgentId>Agent that created this commit (if multi-agent)
query: StringThe user’s query/input
response: StringThe system’s response
mode: StringMode of interaction (e.g., “standard”, “deep_work”, “super_think”)
reasoning_trace: Option<Value>Reasoning trace (if available)
rag_contributed: boolWhether RAG contributed to this response
artifacts_referenced: Vec<ArtifactId>Artifacts referenced in this interaction
notes_referenced: Vec<NoteId>Notes referenced in this interaction
tools_invoked: Vec<String>Tools invoked during this interaction
tokens_input: i64Input token count
tokens_output: i64Output token count
estimated_cost: Option<f64>Estimated cost (if available)
created_at: DateTime<Utc>When this commit was created
Implementations§
Source§impl MemoryCommit
impl MemoryCommit
Sourcepub fn new(
trajectory_id: TrajectoryId,
scope_id: ScopeId,
query: String,
response: String,
mode: String,
) -> MemoryCommit
pub fn new( trajectory_id: TrajectoryId, scope_id: ScopeId, query: String, response: String, mode: String, ) -> MemoryCommit
Create a new memory commit.
Sourcepub fn with_agent_id(self, agent_id: AgentId) -> MemoryCommit
pub fn with_agent_id(self, agent_id: AgentId) -> MemoryCommit
Set the agent ID.
Sourcepub fn with_reasoning_trace(self, trace: Value) -> MemoryCommit
pub fn with_reasoning_trace(self, trace: Value) -> MemoryCommit
Set the reasoning trace.
Sourcepub fn with_rag_contributed(self, contributed: bool) -> MemoryCommit
pub fn with_rag_contributed(self, contributed: bool) -> MemoryCommit
Set RAG contribution flag.
Sourcepub fn with_artifacts_referenced(
self,
artifacts: Vec<ArtifactId>,
) -> MemoryCommit
pub fn with_artifacts_referenced( self, artifacts: Vec<ArtifactId>, ) -> MemoryCommit
Set referenced artifacts.
Sourcepub fn with_notes_referenced(self, notes: Vec<NoteId>) -> MemoryCommit
pub fn with_notes_referenced(self, notes: Vec<NoteId>) -> MemoryCommit
Set referenced notes.
Sourcepub fn with_tools_invoked(self, tools: Vec<String>) -> MemoryCommit
pub fn with_tools_invoked(self, tools: Vec<String>) -> MemoryCommit
Set tools invoked.
Sourcepub fn with_tokens(self, input: i64, output: i64) -> MemoryCommit
pub fn with_tokens(self, input: i64, output: i64) -> MemoryCommit
Set token counts.
Sourcepub fn with_estimated_cost(self, cost: f64) -> MemoryCommit
pub fn with_estimated_cost(self, cost: f64) -> MemoryCommit
Set estimated cost.
Sourcepub fn total_tokens(&self) -> i64
pub fn total_tokens(&self) -> i64
Get total tokens (input + output).
Trait Implementations§
Source§impl Clone for MemoryCommit
impl Clone for MemoryCommit
Source§fn clone(&self) -> MemoryCommit
fn clone(&self) -> MemoryCommit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more