lex-cognitive-apprenticeship
Collins' cognitive apprenticeship model for brain-modeled agentic AI — six pedagogical methods track skill acquisition toward mastery.
What It Does
Models how agents learn complex skills through apprenticeship relationships. Based on Collins' cognitive apprenticeship theory, each learning session uses one of six methods (modeling, coaching, scaffolding, articulation, reflection, exploration), each with different learning multipliers. Mastery increases per session until it crosses the graduation threshold (0.85).
Core Concept: Six Methods and Their Multipliers
modeling -> base gain (0.08) # observe expert performing
coaching -> 1.5x gain (0.12) # guided practice with feedback
scaffolding -> base gain (0.08) # supported structure
articulation -> base gain (0.08) # explaining what you know
reflection -> base gain (0.08) # comparing to expert model
exploration -> 2.0x gain (0.16) # unsupported problem solving (biggest jump)
Usage
client = Legion::Extensions::CognitiveApprenticeship::Client.new
# Register a new apprenticeship
ap = client.create_apprenticeship(
apprentice: :lex_agent,
mentor: :senior_engineer,
domain: :infrastructure,
skill: :incident_response
)
# Run a coaching session
client.conduct_apprenticeship_session(
apprenticeship_id: ap[:apprenticeship][:id],
method: :coaching
)
# => { mastery_delta: 0.12, mastery: 0.37, phase: :novice }
# Get a recommendation on what to do next
client.recommend_apprenticeship_method(apprenticeship_id: ap[:apprenticeship][:id])
# => { recommended_method: :scaffolding, reason: "low mastery — structure needed" }
# Run an independent exploration session at higher mastery
client.conduct_apprenticeship_session(
apprenticeship_id: ap[:apprenticeship][:id],
method: :exploration
)
# => { mastery_delta: 0.16, mastery: 0.53, phase: :apprentice }
# Check for graduates
client.graduated_apprenticeships
# => apprenticeships where mastery >= 0.85Integration
Pairs with lex-agency (a graduated apprenticeship maps directly to record_mastery — the strongest Bandura efficacy source). Pairs with lex-memory (session outcomes stored as procedural traces) and lex-prediction (predict time to graduation from mastery trajectory).
Development
bundle install
bundle exec rspec
bundle exec rubocopLicense
MIT