agent_reflection
Create and retrieve agent reflections to capture lessons learned from mistakes, successes, and collaborations, enabling continuous improvement for AI agents.
Instructions
Create and retrieve agent reflections for continuous improvement.
Usage Examples: // Create a learning reflection agent_reflection({ action: "create", agentId: "frontend-dev", reflectionType: "learning", content: "Discovered that React.memo can prevent unnecessary re-renders in large lists", lessonsLearned: [ "Use React.memo for expensive components", "Profile before optimizing", "Not all components need memoization" ] })
// Create a mistake reflection agent_reflection({ action: "create", agentId: "backend-dev", reflectionType: "mistake", content: "Forgot to add database indexes, causing slow queries in production", lessonsLearned: [ "Always analyze query patterns before deployment", "Add indexes for frequently filtered columns", "Monitor query performance in staging" ] })
// Create a collaboration reflection agent_reflection({ action: "create", agentId: "code-reviewer", reflectionType: "collaboration", content: "Worked with frontend-dev to establish better PR review guidelines", lessonsLearned: [ "Clear PR descriptions save review time", "Automated checks reduce manual review burden" ], relatedAgents: ["frontend-dev", "test-engineer"] })
// List all reflections for an agent agent_reflection({ action: "list", agentId: "test-engineer" })
// List specific type of reflections agent_reflection({ action: "list", agentId: "project-manager", reflectionType: "success" })
Reflection Types:
learning: New knowledge or insights gained
mistake: Errors made and lessons learned
success: Achievements and what worked well
collaboration: Insights from working with other agents
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform | |
| agentId | Yes | Agent ID | |
| reflectionType | No | Type of reflection | |
| content | No | Reflection content (for create) | |
| lessonsLearned | No | Key takeaways | |
| relatedAgents | No | Other agents involved |