Skip to main content

Learning Adapter

The Learning adapter helps users develop skills with progress tracking and stuck detection.

Installation

from sxth_mind import Mind
from examples.learning import LearningAdapter

mind = Mind(adapter=LearningAdapter())

Identity Types

TypeDescriptionTeaching Style
conceptualNeeds to understand “why”Explain theory first
hands_onLearns by doingJump to examples
structuredFollows curriculumStep-by-step progression
explorerSelf-directed discoveryProvide resources, let them lead

Journey Stages

exploring → foundations → practicing → applying → deepening
              ↓                           ↓
           stuck ←────────────────────────┘
StageToneFocus
exploringWelcomingUnderstand goals, assess level
foundationsPatientCore concepts, fundamentals
practicingEncouragingExercises, repetition
applyingChallengingProjects, real-world use
deepeningCollaborativeAdvanced topics, edge cases
stuckSupportiveIdentify blocker, simplify

Pattern Detection

The Learning adapter tracks:
  • Exercises completed — Practice volume
  • Projects completed — Applied learning
  • Stuck indicators — Repeated questions, frustration signals
  • Learning velocity — Progress rate
  • Preferred format — Examples vs. theory

Nudge Templates

NudgePriorityTrigger
practice_reminder5No practice in 3+ days
stuck_support8Detected frustration or repeated asks
milestone4Completed exercise set or project
next_level5Ready to advance

Example Usage

import asyncio
from sxth_mind import Mind
from examples.learning import LearningAdapter

async def main():
    mind = Mind(adapter=LearningAdapter())

    # Learning Python
    await mind.chat("user_1", "I want to learn Python", project_id="learn_python")
    await mind.chat("user_1", "What are list comprehensions?", project_id="learn_python")
    await mind.chat("user_1", "I don't understand, can you show an example?", project_id="learn_python")

    # The adapter notices preference for examples
    state = await mind.get_state("user_1", project_id="learn_python")
    print(f"Identity type: {state['user_mind'].get('identity_type')}")
    # → Likely "hands_on" based on asking for examples

asyncio.run(main())

Multi-Topic Support

Track multiple learning topics:
await mind.chat("user_1", "Learning Python basics", project_id="learn_python")
await mind.chat("user_1", "Started a React course", project_id="learn_react")
await mind.chat("user_1", "Practicing SQL queries", project_id="learn_sql")

# Each topic has its own progress and stage

Stuck Detection

The adapter detects when users are stuck:
# These signals trigger "stuck" stage:
# - Repeated similar questions
# - Phrases like "I don't understand", "confused", "stuck"
# - Long gaps in progress
# - Decreasing momentum

# Response adapts:
# - Simplify explanations
# - Offer alternative approaches
# - Break down into smaller steps

Context Data

The adapter stores in project_mind.context_data:
{
    "topic": "python",
    "current_module": "loops",
    "exercises_completed": 12,
    "projects_completed": 1,
    "stuck_count": 2,
    "preferred_format": "examples",
}