Skip to main content

Module chat_workflow

Module chat_workflow 

Source
Expand description

ChatWorkflow - DAG wrapper for chat conversations

Turns every chat message into a traceable DAG node with stable NodeIndex. Foundation for @mention references where @N references stay valid after deletion.

§Architecture

ChatWorkflow {
    dag: StableDag<ChatMessage>,
    message_counter: u32,
    id_to_index: HashMap<String, NodeIndex>,
}

Sequential Flow:
[msg-001] ──► [msg-002] ──► [msg-003] ──► [msg-004]
   User        Assistant      User        Assistant

Structs§

ChatMessage
A chat message as a DAG node.
ChatWorkflow
DAG wrapper for chat conversation.

Enums§

Role
Role of a chat message participant.