pub struct AgentSession {
pub session_id: String,
pub agent_id: AgentId,
pub steps: Vec<ReActStep>,
pub memory_hits: usize,
pub graph_lookups: usize,
pub duration_ms: u64,
pub checkpoint_errors: Vec<String>,
}Expand description
The result of a single agent run.
Fields§
§session_id: StringStable unique identifier for this session (UUID v4 string).
agent_id: AgentIdThe agent ID used for this session.
steps: Vec<ReActStep>All ReAct steps executed during the session.
memory_hits: usizeNumber of episodic memory retrievals made during the session.
graph_lookups: usizeNumber of graph lookups made during the session.
duration_ms: u64Wall-clock duration of the session in milliseconds.
checkpoint_errors: Vec<String>Non-fatal errors encountered while saving per-step checkpoints.
Populated only when a persistence backend is configured. A non-empty list means some step snapshots may be missing from storage, but the session itself completed successfully.
Implementations§
Source§impl AgentSession
impl AgentSession
Sourcepub fn step_count(&self) -> usize
pub fn step_count(&self) -> usize
Return the number of steps in the session.
Each ReActStep in steps carries a step_duration_ms field measuring
wall-clock time from inference call to observation for that individual step.
Use this to identify slow steps:
for (i, step) in session.steps.iter().enumerate() {
println!("step {i}: {}ms", step.step_duration_ms);
}Sourcepub fn final_answer(&self) -> Option<String>
pub fn final_answer(&self) -> Option<String>
Return the final answer text from the last step, if available.
Extracts the content after FINAL_ANSWER in the last step’s action field.
Returns None if there are no steps or the last action is not a FINAL_ANSWER.
Trait Implementations§
Source§impl Clone for AgentSession
impl Clone for AgentSession
Source§fn clone(&self) -> AgentSession
fn clone(&self) -> AgentSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more