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.

ParameterTypeDescription
contextstringCurrent task context
domainstringFilter by domain
task_typestringFilter by task type
limitnumberMax 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.

ParameterTypeRequiredDescription
memory_idsstring[]YesSource memory IDs
namestringYesSkill name
domainstring[]YesTarget domains
descriptionstringNoSkill description
check_conflictsbooleanNoCheck 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.

ParameterTypeDescription
domainstringFilter by domain
daysnumberLook back period
limitnumberMax 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.

ParameterTypeRequiredDescription
skill_idstringYesSkill that was applied
outcomestringYessuccess or failure
notesstringNoAdditional 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.

ParameterTypeDescription
domainstringFilter by domain
querystringContext description
memory_limitnumberMax memories
skill_limitnumberMax 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
Previous
Skill Tools