Skip to main content

build_event

Function build_event 

Source
pub async fn build_event(
    engine: &MnemoEngine,
    agent_id: &str,
    event_type: EventType,
    payload: Value,
    content_for_hash: &str,
    thread_id: Option<String>,
) -> AgentEvent
Expand description

Build an AgentEvent with proper hash chain linking.

Looks up the latest event hash for the agent and computes prev_hash to maintain chain integrity. This centralizes event construction that was previously duplicated across 8 query files.