Edu SDKEdu SDK

Core

Generation APIs in the edu-sdk package.

edu-sdk generates learning materials from content. Pass a model (string ID or AI SDK LanguageModel), content (string or FileContent), optional difficulty (easy | medium | hard), and optional learnerContext.

Every generator returns an Artifact<T> envelope. Invalid options throw InvalidInputError. Unsupported or empty files throw UnsupportedContentError / ContentExtractionError.

When to use which

GoalAPI
One material typeA single generator below
Several materials from the same contentcreateLearningSet()
Timed agenda plus materialscreateStudySession()
Text from a file firstextractContent()
Score quiz answersgradeQuiz() / Assessment
Personalize from past work / quiz historyPersonalization (buildLearnerContext, analyzePastWork)

Content

FunctionReturns
extractContent()Extracted text from file bytes (not an artifact)

Pass a file object directly as content on any create* call, or extract first to inspect / cache / trim. See Working with files.

Generators

Functioncontent type
createFlashcards()Flashcard[] (each with id, optional topics)
createNote()Markdown string
createQuiz()QuizQuestion[] (each with required id, optional topics)
createStudyGuide()StudyGuideContent (key concepts may include topics)
createPracticeProblems()PracticeProblem[] (each with id, optional topics)

Workflows

Functioncontent type
createLearningSet()Nested artifacts chosen via include
createStudySession()Timed agenda + LearningSetContent materials

Assessment

FunctionRole
gradeQuiz()Deterministic scoring; optional byTopic when questions have topics
AssessmentcreateQuizAttempt() / completeQuizAttempt() for attempt lifecycle

Personalization

APIRole
buildLearnerContext()Pure merge of focus / exam / quiz signals → LearnerContext
analyzePastWork()LLM diagnostic of past exams/homework → Artifact<PastWorkAnalysis>

See the Personalization guide for the closed loop. See Quick Start for a full createQuiz example, and Concepts for the shared contract.

On this page