episode-start
Episode Start
Start a new learning episode in the self-learning memory system.
Purpose
Create a new episode record with proper context for the memory backend to learn from execution patterns.
Steps
-
Understand the task: Parse the task description and identify:
- Task type (implementation, debugging, refactoring, testing)
- Domain (storage, patterns, retrieval, testing, etc.)
- Language context (Rust/Tokio/async patterns)
-
Prepare TaskContext: Ensure you have:
language: "rust"domain: One of [storage, patterns, retrieval, embedding, testing, ci]tags: Array of relevant tags (e.g., ["turso", "async", "tokio"])
-
Create episode: Call
SelfLearningMemory::start_episode(task_description, context)- Task description should be clear and concise (1-2 sentences)
- Include relevant context from the user's request
-
Store episode_id: Keep the episode ID for logging subsequent steps
-
Initialize step logging: Prepare to log execution steps with:
- Tool used
- Action taken
- Latency/tokens (if applicable)
- Success status
- Observations
Storage Requirements
- Persist to Turso (durable storage)
- Cache in redb (fast access)
- Store context as JSON blob
Example
let context = TaskContext {
language: "rust".to_string(),
domain: "storage".to_string(),
tags: vec!["turso".to_string(), "async".to_string()],
};
let episode_id = memory
.start_episode(
"Implement async batch pattern updates",
context
)
.await?;
Notes
- Always validate that both Turso and redb connections are healthy
- Use anyhow::Result for error handling
- Log any initialization failures with context
More from d-o-hub/rust-self-learning-memory
loop-agent
Execute workflow agents iteratively for refinement and progressive improvement until quality criteria are met. Use when tasks require repetitive refinement, multi-iteration improvements, progressive optimization, or feedback loops until convergence.
51web-search-researcher
Research topics using web search and content fetching to find accurate, current information. Use when you need modern information, official documentation, best practices, technical solutions, or comparisons beyond your training data.
46perplexity-researcher-reasoning-pro
Highest level of research and reasoning capabilities for complex decision-making with significant consequences, strategic planning, technical architecture decisions, multi-stakeholder problems, or high-complexity troubleshooting requiring expert-level judgment and sophisticated reasoning chains. Prioritizes actively maintained repositories and validates website sources for 2025 relevance.
44context-retrieval
Retrieve relevant episodic context from memory for informed decision-making. Use when you need past episodes, patterns, or solutions to similar tasks.
44rust-code-quality
Perform comprehensive Rust code quality reviews against best practices for async Rust, error handling, testing, and project structure
43codebase-analyzer
Analyze implementation details, trace data flow, explain technical workings, locate files, and consolidate codebases. Use when you need to understand HOW code works, find file locations, or assess technical debt.
40