Skip to main content

Module episode

Module episode 

Source
Expand description

Episode management for tracking task execution.

This module provides the core types for tracking and learning from task executions, including episodes, execution steps, and pattern applications.

§Examples

use do_memory_core::{Episode, TaskContext, TaskType, TaskOutcome, ExecutionStep};
use do_memory_core::ExecutionResult;

// Create a new episode
let mut episode = Episode::new(
    "Implement user authentication".to_string(),
    TaskContext::default(),
    TaskType::CodeGeneration,
);

// Add execution steps
let mut step = ExecutionStep::new(1, "planner".to_string(), "Plan implementation".to_string());
step.result = Some(ExecutionResult::Success {
    output: "Plan created".to_string(),
});
episode.add_step(step);

// Complete the episode
episode.complete(TaskOutcome::Success {
    verdict: "Authentication implemented successfully".to_string(),
    artifacts: vec!["auth.rs".to_string()],
});

assert!(episode.is_complete());

Re-exports§

pub use graph_algorithms::find_all_cycles_from_node;
pub use graph_algorithms::find_path_dfs;
pub use graph_algorithms::get_ancestors;
pub use graph_algorithms::get_transitive_closure;
pub use graph_algorithms::has_cycle;
pub use graph_algorithms::has_path_dfs;
pub use graph_algorithms::topological_sort;
pub use relationship_errors::GraphError;
pub use relationship_errors::RemovalError;
pub use relationship_errors::ValidationError;
pub use relationship_manager::RelationshipManager;
pub use relationships::Direction;
pub use relationships::EpisodeRelationship;
pub use relationships::RelationshipMetadata;
pub use relationships::RelationshipType;
pub use retention::CleanupResult;
pub use retention::DEFAULT_CLEANUP_BATCH_SIZE;
pub use retention::DEFAULT_CLEANUP_INTERVAL;
pub use retention::DEFAULT_MAX_AGE_DAYS;
pub use retention::DEFAULT_MAX_EPISODES;
pub use retention::DEFAULT_MIN_REWARD_THRESHOLD;
pub use retention::EpisodeRetentionPolicy;
pub use retention::RetentionCriterion;
pub use retention::RetentionPolicyError;
pub use retention::RetentionTrigger;
pub use structs::ApplicationOutcome;
pub use structs::Episode;
pub use structs::ExecutionStep;
pub use structs::PatternApplication;
pub use structs::PatternId;

Modules§

graph_algorithms
Graph algorithms for episode relationship analysis.
relationship_errors
Error types for episode relationship operations.
relationship_manager
Relationship manager for episode relationships.
relationships
Episode relationship types and data structures.
retention
Episode Retention Policy and GC Configuration
structs
Episode and ExecutionStep structs and implementations.
validation
Episode validation logic.