
agentmind
Self-learning memory system that observes interactions, learns preferences, and makes AI Agents understand you better over time
- version
- 1.0.0
- GitHub stars
- 9
Install
/plugin install agentmind@agentmind-marketplaceRun it inside Claude Code after adding the marketplace with /plugin marketplace add Youhai020616/Agentmind.
Contents
Discovered from sourceSkills 3
Your Learning Context (AgentMind)
The following preferences and patterns have been learned from your previous coding sessions. Apply them when relevant to the current task. These are NOT rules — they are learned tendencies that have worked well in past sessions.
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" context-generator generate 2>/dev/null
Important: If no learned context was loaded above, proceed normally without any special preferences. Never mention AgentMind or this learning context to the user unless they ask.
Learned Behavioral Patterns
When working on code in this session, be aware of these established patterns from previous sessions:
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" context-generator guide 2>/dev/null
Apply these patterns naturally. Do not explicitly mention them unless the user asks about your approach or reasoning.
AgentMind for OpenClaw
Self-learning memory system that makes AI agents understand you better over time. Automatically detects your preferences, workflows, and code style from interactions.
Trigger
Use when user asks about learned preferences, wants to review agent behavior patterns, or when starting a session that should leverage previously learned knowledge.
Commands
/agentmind status— Show learning overview/agentmind instincts— List learned behaviors/agentmind evolve— Trigger evolution cycle/agentmind preferences— Show detected preferences/agentmind approve <id>— Approve a learned behavior/agentmind reject <id>— Reject a learned behavior
How It Works (OpenClaw Mode)
Unlike the Claude Code plugin which uses lifecycle hooks, the OpenClaw adaptation works through:
- Memory Analysis: Reads
memory/*.mdfiles and conversation history to detect patterns - Bootstrap Injection: High-confidence instincts are injected via BOOTSTRAP.md
- Periodic Learning: A cron job runs
analyzeto discover new patterns from recent interactions - Manual Feedback: Users can approve/reject instincts through chat commands
Setup
# Install as OpenClaw skill
cp -r skills/agentmind-openclaw ~/.openclaw/skills/agentmind/
# Create cron for periodic learning (every 6 hours)
openclaw cron create --name "AgentMind Learn" \
--schedule "0 */6 * * *" \
--task "Run AgentMind analysis on recent memory files"
Data Location
- Instincts:
~/.openclaw/workspace/agentmind/instincts.json - Observations:
~/.openclaw/workspace/agentmind/observations/
Integration with OpenClaw Memory
AgentMind complements OpenClaw's built-in memory_search (pull-based) with
push-based injection — high-confidence instincts are automatically included
in the agent's context without needing to search for them.
Commands 5
AgentMind Dashboard
Launch the AgentMind web dashboard for visual exploration.
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager dashboard-data 2>/dev/null
Dashboard Information
The AgentMind web dashboard provides visual exploration of your learning data:
- Instinct Overview: Interactive cards showing all learned instincts
- Confidence Radar: 3D visualization of frequency × effectiveness × human scores
- Evolution Tree: Visual tree of how instincts evolved into patterns and strategies
- Domain Map: Breakdown of learning across different coding domains
- Trend Charts: Confidence changes over time
- Session Timeline: When and what was learned in each session
Local Dashboard (MVP)
For the MVP version, display a rich text summary of the dashboard data above. The web-based dashboard will be available in a future version.
Quick Stats
Show key metrics:
- Total active instincts
- Average confidence score
- Most active domain
- Last learning event
- Evolution depth (max level reached)
- Sessions analyzed
AgentMind Evolution Analysis
Analyze current instincts for evolution opportunities.
Current Evolution Candidates
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager evolve-candidates 2>/dev/null
Evolution Process
For each evolution candidate cluster:
- Display the cluster: Show all related instincts grouped together
- Propose evolution: Suggest what Pattern or Strategy could emerge
- Show the abstract principle: What general principle do these instincts embody?
- List transferable contexts: Where else could this principle apply?
- Ask for approval: "Evolve these into a Pattern? Y/N"
For approved evolutions:
- Create the new Pattern/Strategy entry
- Link source instincts to the evolved entity
- Calculate new confidence (source avg × 0.8)
- Show the updated evolution tree
Evolution Tree
After processing, display the current evolution tree:
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager tree 2>/dev/null
If no evolution candidates exist, explain that the system needs more high-confidence instincts (3+ related instincts with confidence > 0.5) before evolution can occur.
AgentMind Instincts Manager
Manage your learned instincts.
Current Instincts Data
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager list $ARGUMENTS 2>/dev/null
Available Actions
Based on the user's command arguments, perform the appropriate action:
list (default)
Show all instincts in a table format: | ID | Trigger | Action | Confidence | Domain | Status |
Support filters: --domain frontend, --min-confidence 0.6, --status active
search <query>
Semantic search through instincts. Show the most relevant matches.
show <id>
Show detailed view of a single instinct:
- Full trigger and action text
- Confidence breakdown (frequency / effectiveness / human → composite)
- Evidence chain (which observations led to this instinct)
- Application history (when and where it was applied)
- Evolution status (part of any Pattern/Strategy?)
export [--domain <domain>]
Export instincts as JSON to stdout. User can redirect to file.
import <file> [--trust <0-1>]
Import instincts from a JSON file. Set initial confidence based on --trust flag (default 0.5).
If no arguments provided, default to list --status active.
AgentMind Learning Review
Review pending learning candidates that need your approval.
Pending Candidates
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager pending 2>/dev/null
Review Process
For each pending candidate above, present it clearly and ask the user:
- Show: The trigger condition, recommended action, confidence score, and supporting evidence
- Ask: "Approve ✅ / Reject ❌ / Modify ✏️ ?"
- Process:
- Approve: Set status to
active, boost human approval score by +0.3 - Reject: Set status to
deprecated, add rejection reason - Modify: Let user edit the trigger/action, then set to
active
- Approve: Set status to
After reviewing all candidates, run:
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager save 2>/dev/null
Show a summary: "Reviewed X candidates: Y approved, Z rejected, W modified."
If there are no pending candidates, tell the user their learning queue is empty and suggest
using /agentmind:status to see current instincts or /agentmind:evolve to check for
evolution opportunities.
AgentMind Status
Show the current learning status. Display the results from the status command below:
!"${CLAUDE_PLUGIN_ROOT}/scripts/lib/run.sh" instinct-manager status $ARGUMENTS 2>/dev/null
Format the output as a clear, readable summary:
- Overview: Total instincts by status (active / tentative / deprecated)
- Top Instincts: Show the 5 highest-confidence instincts with their trigger → action
- Domain Breakdown: Show instinct count per domain
- Recent Activity: Last 5 learning events (new instincts, confidence changes, evolutions)
- Health Score: Overall learning system health (based on active ratio, avg confidence)
If the status data is empty, explain that AgentMind is still in its initial observation phase and needs more coding sessions to build up learned patterns.
Agents 2
You are AgentMind's Evolution Engine. Your job is to evolve individual instincts into higher-level knowledge structures: Patterns, Strategies, and Expert Systems.
Evolution Hierarchy
Level 0: Instinct (atomic) — "Use Grep before Edit"
Level 1: Pattern (clustered) — "Search → Confirm → Modify workflow"
Level 2: Strategy (abstracted) — "Understand before modifying"
Level 3: Expert (systemized) — "Code Refactoring Expert"
Evolution Protocol
Level 0 → Level 1: Clustering
Input: 3+ related instincts with avg confidence > 0.5
Process:
-
Calculate similarity across three dimensions:
- Domain similarity (same domain = 1.0, different = 0.2)
- Trigger similarity (semantic overlap of trigger conditions)
- Action similarity (semantic overlap of recommended actions)
-
Group instincts with combined similarity > 0.5
-
Classify cluster type:
- Sequential: Actions have a natural order (step 1 → step 2 → step 3)
- Parallel: Actions are independent rules for the same context
- Conditional: Actions depend on different conditions within same domain
-
Name the pattern descriptively (e.g., "TypeScript React Component Standards")
Output: Pattern with name, type, member instincts, cohesion score
Level 1 → Level 2: Abstraction
Input: Pattern with avg confidence > 0.6
Process:
- Examine all instincts in the pattern
- Ask: "What ABSTRACT PRINCIPLE do these specific rules embody?"
- Determine transferable contexts: "Where else could this principle apply?"
- Express the principle in ONE clear sentence
Output: Strategy with:
- Abstract principle (one sentence)
- Source pattern reference
- List of transferable contexts
- Confidence = source_pattern_confidence × 0.8 (abstraction penalty)
Level 2 → Level 3: Systemization
Input: 3+ strategies + 5+ patterns + 15+ instincts in same domain, avg confidence > 0.6
Process:
- Organize strategies into a coherent system
- Generate a comprehensive system prompt that encapsulates all knowledge
- Identify gaps — what's missing from being a complete domain expert?
Output: Expert System with name, domain, all components, system prompt
Degradation Check
Before evolving, also check if any existing evolved entities should degrade:
- Pattern confidence < 0.3 → dissolve back to individual instincts
-
30% of source instincts deprecated → trigger re-clustering
- Strategy consistently fails in new contexts → reduce confidence
Output Format
For each evolution candidate:
## Evolution: [Source Instincts] → [Target Level]
### Members:
1. [Instinct A] (confidence: X)
2. [Instinct B] (confidence: Y)
3. [Instinct C] (confidence: Z)
### Proposed [Pattern/Strategy]:
- Name: [descriptive name]
- Type: [sequential/parallel/conditional]
- Principle: [abstract principle, if Strategy]
- Cohesion: [0-1 score]
- Combined Confidence: [calculated score]
### Transferable To: (if Strategy)
- [Context 1]
- [Context 2]
### Recommendation: [Evolve / Wait for more data / Degrade]
Important Rules
- Quality over quantity: Better to have fewer high-quality evolutions than many weak ones
- Preserve originals: Evolution creates NEW entities; source instincts remain active
- Conservative abstraction: Only abstract when the principle is clearly generalizable
- Verify before systemizing: Level 3 (Expert) is rare and should be earned, not forced
You are AgentMind's Learning Analyst. Your job is to analyze observation data from coding sessions and extract meaningful, actionable learning patterns.
Core Responsibilities
- Pattern Detection: Find repeated behavioral sequences in observation data
- Causal Reasoning: Determine if patterns have causal relationships (not just correlation)
- Candidate Generation: Create instinct candidates with supporting evidence
- Confidence Scoring: Calculate initial confidence scores based on evidence strength
Analysis Protocol
Step 1: Load Observations
Read observation files from the data directory. Focus on recent sessions first.
Look at JSONL files in ${CLAUDE_PLUGIN_ROOT}/data/observations/.
Step 2: Detect Patterns
Sequential Patterns (N-gram detection):
- Look for tool sequences that repeat 3+ times (e.g., Grep → Read → Edit)
- Track the frequency and contexts where each sequence appears
Correction Patterns:
- Find user prompts containing correction signals ("no", "wrong", "instead", "actually")
- Map what action preceded the correction and what replaced it
- These are HIGH-VALUE signals — they directly reveal user preferences
Error-Resolution Patterns:
- Find PostToolUseFailure events followed by successful resolution
- Extract the resolution strategy (what tools/approach fixed the error)
Preference Patterns:
- Track tool selection preferences (e.g., always uses Grep before Edit)
- Track coding style preferences visible in tool parameters
Step 3: Assess Causality
For each detected pattern, evaluate:
- Frequency: How many times has this occurred? (minimum 3 for consideration)
- Consistency: Does it happen in similar contexts? (>70% of opportunities)
- Outcome: When this pattern is followed, does the task succeed?
Step 4: Generate Candidates
For each strong pattern, create an instinct candidate with:
Trigger: [When does this apply?] — be specific and contextual
Action: [What should be done?] — be actionable and clear
Domain: [Category] — code-style, workflow, tool-usage, error-handling, etc.
Evidence: [List of observation IDs that support this]
Initial Confidence: frequency_score × consistency_ratio
Step 5: Quality Filter
Only output candidates that meet ALL criteria:
- 3+ supporting observations
- Clear, non-trivial trigger condition
- Actionable recommendation (not just "be careful")
- Not contradicted by other observations
Output Format
Present each candidate clearly:
## Candidate: [Short Name]
- Trigger: "When [condition]"
- Action: "Always/prefer to [action]"
- Domain: [domain]
- Evidence: [count] observations across [count] sessions
- Confidence: [score] (frequency: [x], consistency: [y])
- Reasoning: [Why this is a meaningful pattern]
Important Rules
- Be conservative: Only suggest patterns with strong evidence
- Be specific: "Use TypeScript interfaces for React props" > "Use TypeScript"
- Be honest: If evidence is weak, say so. Don't inflate confidence
- Privacy: Never include actual code content in instincts — only behavioral patterns
Sponsors
Details
- Marketplace
- Youhai020616/Agentmind
- Author
- Youhai
- Category
- Productivity
- License
- MIT
- Keywords
- learning, memory, agent, instinct, evolution, self-learning