feat: add research cycle skill and /research command for continuous self-improvement
- Created research-cycle skill with automatic monitoring - Added /research command for manual or automatic research - Configured research sources: Anthropic, OpenAI, Lilian Weng - Implemented evolution tracking workflow Components: - .kilo/skills/research-cycle/SKILL.md: Self-improvement logic - .kilo/commands/research.md: Research command definition - AGENTS.md: Added /research to command list Milestone: Cognitive Enhancement - Agent Evolution (#47) Related: Issue #25 (Research Milestone)
This commit is contained in:
83
.kilo/commands/research.md
Normal file
83
.kilo/commands/research.md
Normal file
@@ -0,0 +1,83 @@
|
||||
---
|
||||
description: Run continuous research and self-improvement cycle
|
||||
mode: workflow
|
||||
model: ollama-cloud/glm-5
|
||||
color: "#8B5CF6"
|
||||
permission:
|
||||
read: allow
|
||||
edit: allow
|
||||
write: allow
|
||||
bash: allow
|
||||
webfetch: allow
|
||||
task:
|
||||
"capability-analyst": allow
|
||||
"agent-architect": allow
|
||||
---
|
||||
|
||||
# Research Cycle Command
|
||||
|
||||
Runs continuous research and self-improvement cycle based on the latest findings.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/research [topic] [--auto]
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `topic`: Optional specific research topic
|
||||
- `--auto`: Automatic mode (no user input)
|
||||
|
||||
## Execution
|
||||
|
||||
### Step 1: Performance Monitoring
|
||||
|
||||
Check `.kilo/logs/efficiency_score.json` for low-performing agents.
|
||||
|
||||
### Step 2: Gap Identification
|
||||
|
||||
Analyze capability-index.yaml for missing capabilities.
|
||||
|
||||
### Step 3: Research Fetching
|
||||
|
||||
Fetch latest research from:
|
||||
- Anthropic: https://www.anthropic.com/research
|
||||
- OpenAI: https://platform.openai.com/docs/guides/agents
|
||||
- Lilian Weng: https://lilianweng.github.io
|
||||
|
||||
### Step 4: Implementation
|
||||
|
||||
Create new agents, skills, or rules based on findings.
|
||||
|
||||
### Step 5: Evolution Tracking
|
||||
|
||||
Post findings to Gitea Issue #25 (Research Milestone).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
/research multi-agent systems
|
||||
|
||||
# Output:
|
||||
## Research: multi-agent systems
|
||||
|
||||
### Sources Fetched
|
||||
- Anthropic: Building Effective Agents
|
||||
- OpenAI: Agents Overview
|
||||
- Lilian Weng: LLM Powered Agents
|
||||
|
||||
### Key Findings
|
||||
- Prompt Chaining pattern for sequential tasks
|
||||
- Routing for specialized agents
|
||||
- Parallelization for independent tasks
|
||||
|
||||
### Implementations
|
||||
- Created: @planner agent (CoT, ToT)
|
||||
- Created: @reflector agent (Reflexion)
|
||||
- Created: @memory-manager agent
|
||||
|
||||
### Evolution Tracked
|
||||
- Issue: #25
|
||||
- Commit: abc1234
|
||||
```
|
||||
212
.kilo/skills/research-cycle/SKILL.md
Normal file
212
.kilo/skills/research-cycle/SKILL.md
Normal file
@@ -0,0 +1,212 @@
|
||||
# Research Cycle Skill
|
||||
|
||||
Continuous research and self-improvement cycle for autonomous agents.
|
||||
|
||||
## Overview
|
||||
|
||||
This skill implements a continuous research loop that:
|
||||
1. Monitors agent performance
|
||||
2. Identifies improvement opportunities
|
||||
3. Researches best practices
|
||||
4. Implements improvements
|
||||
5. Tracks evolution in Gitea
|
||||
|
||||
## Research Sources
|
||||
|
||||
### Primary Sources
|
||||
- Anthropic Research Blog (https://www.anthropic.com/research)
|
||||
- OpenAI Documentation (https://platform.openai.com/docs)
|
||||
- Lilian Weng's Blog (https://lilianweng.github.io)
|
||||
- Google AI Blog (https://blog.google/technology/ai/)
|
||||
|
||||
### Research Topics
|
||||
- Multi-agent systems
|
||||
- Prompt engineering
|
||||
- Tool use patterns
|
||||
- Memory architectures
|
||||
- Planning strategies
|
||||
- Self-improvement
|
||||
|
||||
## Research Workflow
|
||||
|
||||
```
|
||||
[Monitor Performance]
|
||||
↓
|
||||
[Identify Gaps] → Create Gitea Issue
|
||||
↓
|
||||
[Research Best Practices] → Fetch from sources
|
||||
↓
|
||||
[Implement Improvements] → Create files
|
||||
↓
|
||||
[Test & Validate] → Run tests
|
||||
↓
|
||||
[Document Evolution] → Post milestone
|
||||
↓
|
||||
[Monitor Performance]
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
### 1. Performance Monitoring
|
||||
|
||||
```python
|
||||
def monitor_agent_performance():
|
||||
"""Monitor agent performance from .kilo/logs/"""
|
||||
|
||||
scores = load_efficiency_scores()
|
||||
|
||||
for agent, score in scores.items():
|
||||
if score < THRESHOLD:
|
||||
create_improvement_issue(
|
||||
agent=agent,
|
||||
current_score=score,
|
||||
research_topic=f"{agent} improvement"
|
||||
)
|
||||
```
|
||||
|
||||
### 2. Gap Identification
|
||||
|
||||
```python
|
||||
def identify_gaps():
|
||||
"""Identify missing capabilities based on tasks"""
|
||||
|
||||
tasks = load_completed_tasks()
|
||||
capabilities = load_capability_index()
|
||||
|
||||
gaps = []
|
||||
for task in tasks:
|
||||
if not has_capability(task, capabilities):
|
||||
gaps.append({
|
||||
"task": task,
|
||||
"missing": find_missing_capability(task)
|
||||
})
|
||||
|
||||
return gaps
|
||||
```
|
||||
|
||||
### 3. Research Best Practices
|
||||
|
||||
```python
|
||||
def research_best_practices(topic):
|
||||
"""Fetch latest research on topic"""
|
||||
|
||||
sources = [
|
||||
"https://www.anthropic.com/research",
|
||||
"https://platform.openai.com/docs/guides/agents",
|
||||
"https://lilianweng.github.io"
|
||||
]
|
||||
|
||||
for source in sources:
|
||||
try:
|
||||
content = webfetch(source)
|
||||
if contains_relevant_info(content, topic):
|
||||
return extract_improvements(content, topic)
|
||||
except:
|
||||
continue
|
||||
|
||||
return None
|
||||
```
|
||||
|
||||
### 4. Implementation
|
||||
|
||||
```python
|
||||
def implement_improvements(research_findings):
|
||||
"""Implement improvements based on research"""
|
||||
|
||||
for improvement in research_findings:
|
||||
if improvement.type == "new_agent":
|
||||
create_agent(improvement.spec)
|
||||
elif improvement.type == "new_skill":
|
||||
create_skill(improvement.spec)
|
||||
elif improvement.type == "rule_update":
|
||||
update_rule(improvement.spec)
|
||||
elif improvement.type == "prompt_update":
|
||||
update_prompt(improvement.spec)
|
||||
```
|
||||
|
||||
### 5. Evolution Tracking
|
||||
|
||||
```python
|
||||
def track_evolution(changes):
|
||||
"""Track evolution in Gitea"""
|
||||
|
||||
post_to_issue(
|
||||
issue_number=EVOLUTION_ISSUE,
|
||||
comment=f"""
|
||||
## Evolution Update
|
||||
|
||||
### Changes
|
||||
{format_changes(changes)}
|
||||
|
||||
### Research Source
|
||||
{changes.source}
|
||||
|
||||
### Impact
|
||||
- Agents affected: {changes.agents}
|
||||
- Capability added: {changes.capability}
|
||||
- Expected improvement: {changes.improvement}
|
||||
|
||||
### Commit
|
||||
{get_last_commit_hash()}
|
||||
"""
|
||||
)
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
```yaml
|
||||
# .kilo/config/research-cycle.yaml
|
||||
|
||||
research_cycle:
|
||||
enabled: true
|
||||
interval_hours: 24
|
||||
|
||||
sources:
|
||||
- url: https://www.anthropic.com/research
|
||||
topics: [agents, prompt-engineering, tool-use]
|
||||
- url: https://platform.openai.com/docs/guides/agents
|
||||
topics: [agents, workflows, tools]
|
||||
- url: https://lilianweng.github.io
|
||||
topics: [agents, memory, planning]
|
||||
|
||||
thresholds:
|
||||
improvement_score: 7
|
||||
max_issues_per_cycle: 3
|
||||
|
||||
tracking:
|
||||
evolution_issue: 25
|
||||
milestone: "Cognitive Enhancement - Agent Evolution"
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Automatic**: Runs every 24 hours
|
||||
2. **Manual**: Invoke with `/research` command
|
||||
3. **Triggered**: When agent score < 7
|
||||
|
||||
## Output
|
||||
|
||||
```markdown
|
||||
## Research Cycle Complete
|
||||
|
||||
### Performance Review
|
||||
- Agents scored < 7: {low_performers}
|
||||
- Improvement opportunities: {opportunities}
|
||||
|
||||
### Research Findings
|
||||
- New patterns found: {patterns}
|
||||
- Best practices: {practices}
|
||||
|
||||
### Implementations
|
||||
- New agents: {agents}
|
||||
- New skills: {skills}
|
||||
- Updated rules: {rules}
|
||||
|
||||
### Evolution Tracked
|
||||
- Issue: #{issue_number}
|
||||
- Commit: {commit_hash}
|
||||
- Milestone: {milestone_name}
|
||||
|
||||
---
|
||||
Next cycle in 24 hours
|
||||
```
|
||||
Reference in New Issue
Block a user