API Reference
Learning Tools API
Complete reference for the learning tools that detect patterns and generate skills.
suggest_skill
Get skill suggestions for current context.
| Parameter | Type | Description |
|---|---|---|
| context | string | Current task context |
| domain | string | Filter by domain |
| task_type | string | Filter by task type |
| limit | number | Max suggestions |
Response
{
"suggestions": [
{
"skill_id": "skill-abc",
"name": "CORS Configuration",
"relevance": 0.92,
"instructions": "..."
}
]
}
generate_skill
Generate a new skill from memories. Optionally check for conflicts with existing skills.
| Parameter | Type | Required | Description |
|---|---|---|---|
| memory_ids | string[] | Yes | Source memory IDs |
| name | string | Yes | Skill name |
| domain | string[] | Yes | Target domains |
| description | string | No | Skill description |
| check_conflicts | boolean | No | Check for similar/conflicting skills |
Response
{
"skill": {
"id": "skill-new123",
"name": "Generated Skill Name",
"status": "draft",
"instructions": "... synthesized from memories ..."
}
}
With Conflict Checking
When check_conflicts: true:
{
"skill": { ... },
"conflicts": [
{
"skill_id": "skill-existing",
"name": "Similar Existing Skill",
"overlap": 0.75
}
],
"warnings": ["Similar skill already exists in domain"]
}
analyze_patterns
Analyze memories to detect patterns.
| Parameter | Type | Description |
|---|---|---|
| domain | string | Filter by domain |
| days | number | Look back period |
| limit | number | Max patterns |
Response
{
"patterns": [
{
"description": "CORS debugging approach",
"memory_count": 4,
"confidence": 0.88,
"memory_ids": ["mem-1", "mem-2", "mem-3", "mem-4"],
"suggested_skill_name": "CORS Debugging Workflow"
}
]
}
report_outcome
Log outcome of applying a skill.
| Parameter | Type | Required | Description |
|---|---|---|---|
| skill_id | string | Yes | Skill that was applied |
| outcome | string | Yes | success or failure |
| notes | string | No | Additional context |
Response
{
"success": true,
"message": "Outcome recorded",
"skill_stats": {
"total_uses": 10,
"success_rate": 0.9
}
}
get_context
Get relevant memories and skills for current session.
| Parameter | Type | Description |
|---|---|---|
| domain | string | Filter by domain |
| query | string | Context description |
| memory_limit | number | Max memories |
| skill_limit | number | Max skills |
Response
{
"memories": [
{
"id": "mem-123",
"observation": "...",
"relevance": 0.85
}
],
"skills": [
{
"id": "skill-456",
"name": "...",
"relevance": 0.92,
"instructions": "..."
}
]
}
Usage Workflow
1. Work on tasks, storing memories
↓
2. analyze_patterns to find repeated approaches
↓
3. generate_skill from pattern memories
↓
4. Review and approve_skill
↓
5. suggest_skill in future similar contexts
↓
6. report_outcome to track effectiveness