Pattern: AI tutor
Education / EdTech — AI tutor pattern. Pedagogical-quality (Socratic vs. answer-giving), age-appropriateness, learning-outcome correlation.
Last updated
Was this helpful?
Was this helpful?
# Python (SDK)
from layerlens import Stratix
client = Stratix()
pedagogical = client.judges.create(
name="socratic-vs-give",
evaluation_goal="Score 1-5: did the tutor guide the student to the answer (5) or hand it over (1)? Penalize answers that bypass the learning step the assignment expects.",
)
age_appropriate = client.judges.create(
name="age-appropriate",
evaluation_goal="Content matches the student's declared age band (input.age_band).",
)
pii_redaction = client.scorers.create_code(
name="ferpa-pii-redaction",
code="result = {'passed': not contains_student_record_fields(trace)}",
)
trace_eval = client.trace_evaluations.create(
trace_set={"tags": {"feature": "tutor"}, "sample_rate": 0.005},
scorers=[pii_redaction.id, subject_answer_key_id],
judges=[pedagogical.id, age_appropriate.id],
schedule="daily",
)// TypeScript (REST)
const r = await fetch("https://stratix.layerlens.ai/api/v1/trace-evaluations", {
method: "POST",
headers: {
"X-API-Key": process.env.LAYERLENS_STRATIX_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
trace_set: { tags: { feature: "tutor" }, sample_rate: 0.005 },
scorers: [piiRedactionId, subjectAnswerKeyId],
judges: [pedagogicalId, ageAppropriateId],
schedule: "daily",
}),
});