npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

education-module-ai

v0.1.2

Published

AI Education Module using Agent Framework

Downloads

7

Readme

Education Module for Agent Framework

This module provides educational content management, learning sessions, and user profile tracking for the Agent Framework.

Features

  • Educational Content Management: Create, retrieve, and search educational content across various subjects and levels
  • Learning Sessions: Interactive learning sessions with AI-powered responses and content recommendations
  • User Profiles: Track user progress, learning styles, strengths, and weaknesses
  • Analytics: Track usage patterns and learning progress
  • Notifications: Send notifications for learning activities and achievements
  • Reusable UI Components: Ready-to-use React components for quizzes, Q&A, and learning paths

Installation

npm install @agent-framework/education-module

Usage

Backend Integration

import { initializeEducationAPI } from '@agent-framework/education-module';

// Initialize the education API
const app = await initializeEducationAPI();

// The API is now running with the following endpoints:
// - /api/educational-contents
// - /api/learning-sessions
// - /api/user-profiles

Frontend Integration

Using Data Resources

import { 
  EducationalContentResource, 
  LearningSessionResource,
  UserProfileResource 
} from '@agent-framework/education-module';

// Fetch educational content
const fetchContent = async (subject) => {
  const response = await fetch(`/api/educational-contents/subject/${subject}`);
  const { data } = await response.json();
  return data;
};

// Start a learning session
const startSession = async (userId, subject, level) => {
  const response = await fetch('/api/learning-sessions/start', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ userId, subject, level }),
  });
  const { data } = await response.json();
  return data;
};

// Send a message in a learning session
const sendMessage = async (sessionId, content) => {
  const response = await fetch(`/api/learning-sessions/${sessionId}/message`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ content }),
  });
  const { data } = await response.json();
  return data;
};

Using React Components

import React from 'react';
import { 
  QuizComponent, 
  AnswerQuestionComponent, 
  LearningPathComponent 
} from '@agent-framework/education-module';

// In your React application
const EducationPage: React.FC = () => {
  return (
    <div className="education-container">
      <h1>Education Portal</h1>
      
      {/* Quiz Component */}
      <QuizComponent 
        title="Computer Science Quiz" 
        description="Test your knowledge in computer science"
        onComplete={(score) => console.log('Quiz completed with score:', score)}
      />
      
      {/* Q&A Component */}
      <AnswerQuestionComponent 
        title="Ask Your Questions"
        onAnswer={(question, answer) => console.log('Question answered:', question)}
      />
      
      {/* Learning Path Component */}
      <LearningPathComponent 
        title="Generate Learning Path"
        onGenerate={(path) => console.log('Learning path generated:', path)}
      />
    </div>
  );
};

export default EducationPage;

UI Components

Quiz Component

The QuizComponent allows users to generate and take quizzes on any topic.

import { QuizComponent } from '@agent-framework/education-module';

<QuizComponent 
  title="Custom Quiz Title" 
  description="Custom description for this quiz generator"
  onComplete={(score) => {
    console.log(`Quiz completed with ${score.percentage}% correct`);
  }}
  className="custom-class-name"
/>

Props

  • title: Optional custom title for the quiz component
  • description: Optional custom description text
  • onComplete: Optional callback function that's called when a quiz is completed
  • className: Optional CSS class name for styling

Answer Question Component

The AnswerQuestionComponent provides an interface for users to ask educational questions and get AI-powered answers.

import { AnswerQuestionComponent } from '@agent-framework/education-module';

<AnswerQuestionComponent 
  title="Custom Q&A Title" 
  description="Ask any question and get detailed answers"
  onAnswer={(question, answer) => {
    console.log(`Question: ${question}`);
    console.log(`Answer: ${answer.answer}`);
  }}
  className="custom-class-name"
/>

Props

  • title: Optional custom title for the Q&A component
  • description: Optional custom description text
  • onAnswer: Optional callback function that's called when a question is answered
  • className: Optional CSS class name for styling

Learning Path Component

The LearningPathComponent generates personalized learning paths for any topic.

import { LearningPathComponent } from '@agent-framework/education-module';

<LearningPathComponent 
  title="Custom Learning Path Title" 
  description="Generate a personalized learning path for any topic"
  onGenerate={(path) => {
    console.log(`Learning path generated for: ${path.subject}`);
  }}
  className="custom-class-name"
/>

Props

  • title: Optional custom title for the learning path component
  • description: Optional custom description text
  • onGenerate: Optional callback function that's called when a learning path is generated
  • className: Optional CSS class name for styling

API Endpoints

Educational Content

  • GET /api/educational-contents: Get all educational content
  • GET /api/educational-contents/:id: Get content by ID
  • POST /api/educational-contents: Create new content
  • PUT /api/educational-contents/:id: Update content
  • DELETE /api/educational-contents/:id: Delete content
  • POST /api/educational-contents/generate: Generate content using AI
  • POST /api/educational-contents/quiz: Generate a quiz
  • GET /api/educational-contents/search: Search for content
  • GET /api/educational-contents/subject/:subject: Get content by subject
  • GET /api/educational-contents/level/:level: Get content by level

Learning Sessions

  • GET /api/learning-sessions: Get all learning sessions
  • GET /api/learning-sessions/:id: Get session by ID
  • POST /api/learning-sessions/start: Start a new learning session
  • POST /api/learning-sessions/:id/end: End a learning session
  • POST /api/learning-sessions/:id/message: Send a message in a session
  • GET /api/learning-sessions/user/:userId: Get all sessions for a user
  • GET /api/learning-sessions/user/:userId/active: Get active session for a user

User Profiles

  • GET /api/user-profiles: Get all user profiles
  • GET /api/user-profiles/:id: Get profile by ID
  • POST /api/user-profiles/initialize: Initialize a new user profile
  • PUT /api/user-profiles/:id/learning-styles: Update learning styles
  • POST /api/user-profiles/:id/subjects: Add a subject to user profile
  • GET /api/user-profiles/:id/recommendations: Get learning recommendations
  • GET /api/user-profiles/:id/progress/:subject: Get subject progress
  • POST /api/user-profiles/:id/attributes: Add strength or weakness

Models

Educational Content

enum ContentType {
  LESSON = "lesson",
  EXERCISE = "exercise",
  QUIZ = "quiz",
  ARTICLE = "article",
  VIDEO = "video",
  INTERACTIVE = "interactive",
}

enum EducationalLevel {
  BEGINNER = "beginner",
  INTERMEDIATE = "intermediate",
  ADVANCED = "advanced",
}

enum Subject {
  MATHEMATICS = "mathematics",
  SCIENCE = "science",
  HISTORY = "history",
  LANGUAGE_ARTS = "language_arts",
  COMPUTER_SCIENCE = "computer_science",
  ART = "art",
  MUSIC = "music",
  PHYSICAL_EDUCATION = "physical_education",
  FOREIGN_LANGUAGE = "foreign_language",
}

interface EducationalContentResource {
  id: string;
  title: string;
  description: string;
  content: string;
  type: ContentType;
  subject: Subject;
  level: EducationalLevel;
  tags: string[];
  createdAt: Date;
  updatedAt: Date;
  author?: string;
  relatedContentIds?: string[];
}

Learning Session

enum InteractionType {
  QUESTION = "question",
  ANSWER = "answer",
  EXPLANATION = "explanation",
  QUIZ_RESPONSE = "quiz_response",
  FEEDBACK = "feedback",
}

interface SessionMessage {
  role: "user" | "assistant";
  content: string;
  timestamp: Date;
  interactionType: InteractionType;
  relatedContentIds?: string[];
}

interface LearningSessionResource {
  id: string;
  userId: string;
  subject: Subject;
  level: EducationalLevel;
  startTime: Date;
  endTime?: Date;
  active: boolean;
  messages: SessionMessage[];
  feedback?: string;
}

User Profile

enum LearningStyle {
  VISUAL = "visual",
  AUDITORY = "auditory",
  READING_WRITING = "reading_writing",
  KINESTHETIC = "kinesthetic",
  LOGICAL = "logical",
  SOCIAL = "social",
  SOLITARY = "solitary",
}

interface SubjectProgress {
  level: EducationalLevel;
  completedSessions: number;
  lastSessionDate: Date | null;
  masteredConcepts: string[];
  strugglingConcepts: string[];
  score: number;
}

interface UserProfileResource {
  id: string;
  name?: string;
  email?: string;
  createdAt: Date;
  updatedAt: Date;
  subjectProgress: Record<Subject, SubjectProgress>;
  learningStyles: LearningStyle[];
  strengths: string[];
  weaknesses: string[];
}

License

MIT