Plugin endpoints¶
Each plugin's routes mount under /api/plugins/{plugin-name}/.
Assessment plugin¶
Returns the 12-question pack with text resolved to the
requested language. Each answer carries the per-method
weights.
[
{
"id": "q01",
"type": "multi",
"text": "How do you approach a new topic?",
"answers": [
{
"id": "a",
"text": "I read the rules and theory first.",
"weights": {"deductive": 1.0}
},
...
]
},
...
]
Body:
{
"project_id": "p1",
"answers": [
{"question_id": "q01", "answer_ids": ["a", "b"]},
{"question_id": "q02", "answer_id": "c"},
...
]
}
Both single-select (answer_id: string) and multi-select
(answer_ids: string[]) shapes are accepted. Returns the
created LearningProfile:
{
"id": "pr1",
"user_id": "abc-123",
"project_id": "p1",
"deductive": 0.4167,
"inductive": 0.1833,
"error_based": 0.0833,
"dialogic": 0.0833,
"contextual": 0.0833,
"ai_adaptive": 0.1500,
"assessed_at": "2026-05-19T12:00:00+00:00",
"version": 1,
"dominant_method": "deductive"
}
Returns the latest LearningProfile for the project.
Session plugin¶
Body:
method, cycle_step, lang are optional. Returns the
created session + the composed system prompt:
{
"session": {
"id": "s1",
"project_id": "p1",
"method": "deductive",
"started_at": "2026-05-19T12:00:00+00:00",
"ended_at": null,
"cycle_step": 1,
"status": "active"
},
"system_prompt": "You are a deductive learning companion. ..."
}
Body:
The server saves the user message, fires ai_complete,
persists the assistant reply, runs the step evaluator, and
returns the composite:
{
"user_message": {"id": "m1", "session_id": "s1", "role": "user", "content": "...", "created_at": "..."},
"assistant_message": {"id": "m2", "session_id": "s1", "role": "assistant", "content": "...", "created_at": "..."},
"ai_error": null,
"session": {"...": "session row after cycle_step advance"},
"step_evaluation": {
"advance": true,
"confidence": 0.85,
"reason": "Learner clearly grasped the input.",
"suggested_step": 2,
"fallback_used": false,
"applied": true,
"from_step": 1
}
}
Body:
Persists a SessionRating row. Returns the row.
Closes the session. Fires on_session_complete (tracking
plugin writes a ProgressCommit). Returns:
Returns:
Or, when stagnation is detected:
{"recommended": true, "to_method": "dialogic", "reason": "Three sessions of flat understanding + high stress."}
Body:
Updates session.method, writes a MethodSwitch audit row,
returns the updated session.
Tracking plugin¶
Returns the namespaced summary; the tracking slice carries
the aggregator's output:
{
"tracking": {
"total_sessions": 7,
"total_minutes": 195,
"streak_days": 3,
"sessions_per_method": {"deductive": 4, "inductive": 2, "dialogic": 1},
"method_distribution": [...],
"recent_understanding": [0.6, 0.8, 0.8, 0.8, 1.0],
"recent_stress": [0.4, 0.4, 0.2, 0.2, 0.2],
"mean_understanding": 0.8,
"mean_stress": 0.3,
"recent_sessions": [...]
},
"step_evaluation": {
"total_evaluations": 28,
"average_confidence": 0.78,
"advance_count": 21,
"repeat_count": 5,
"backward_count": 2,
"fallback_count": 1,
"evaluations_per_step": {"1": 7, "2": 6, ...},
"time_seconds_per_step": {"1": 180.5, ...}
}
}
Returns all ProgressCommit rows for the project, chronological.
Tools plugin¶
Returns the 5 catalog tools ranked by relevance to the project's profile:
[
{
"name": "Anki",
"url": "https://apps.ankiweb.net/",
"why": "Spaced-repetition flashcards - great for cementing rules and error-corrections long-term.",
"weight_keys": ["deductive", "error_based"],
"score": 0.5
},
...
]
Returns spaced-repetition action cards driven by recency:
[
{
"id": "sr-deductive-first",
"method": "deductive",
"interval_days": 1,
"action": "session",
"title": "First practice in deduction.",
"urgency": 0.5
},
...
]
Plugin discovery¶
Each returns a map keyed by plugin name. Used by the Settings
Plugins UI (deferred in v0.7.0).