Educhain Documentation
repository·main·Indexed 18 days ago
https://github.com/satvik314/educhainA Python package that leverages Generative AI to create personalized educational content, including MCQs, lesson plans, and pedagogy-based learning materials. It supports various AI providers such as Google Gemini 2.0, Groq (Llama4), Anthropic Claude 3.5 Sonnet, and OpenAI. The library includes a cookbook with starter apps for flashcard generation, mock-trial simulation (AI Courtroom), consulting interview prep, and pedagogical content generation based on theories like Bloom's Taxonomy and Socratic Questioning.
What's inside Educhain
- Educhain provides a pedagogy-based content generation system that supports 8 evidence-based pedagogical approaches. Unlike traditional generators that produce simple bullet points or frameworks, Educhain's system is designed for Content-Rich Generation, producing complete, consumable educational content such as detailed study materials, step-by-step procedures, and full educational experiences. This makes it suitable for LMS integration, educational applications, and self-study platforms.
Overview of Educhain features
mainEduchain is a Python package designed for generating personalized educational content using Generative AI.
Content Generation
- MCQs: Generate Multiple Choice Questions with explanations.
- Flashcards: Create flashcards for studying.
- Lesson Plans: Build comprehensive plans including objectives and activities.
- Study Guides: Generate summaries and educational guides.
Technical Capabilities
- LLM Support: Works with Gemini, GPT-4, Claude, and other models.
- Multilingual: Supports multilingual content generation and preservation.
- Multimodal: Generates questions from images and extracts content from YouTube videos.
- Data Sources: Generates questions from URLs, PDFs, and raw text.
Integration & Export
- Formats: Export content to JSON, PDF, CSV, and DOCX.
- Customization: Supports customizable prompt templates.
- App Building: Integrates with Streamlit for building educational applications.
Explore Educhain Features
mainEduchain provides several advanced features for automated educational content generation. Key features include:
- MCQ Generation: Generate Multiple Choice Questions from raw data.
- Flashcards: Create basic flashcards for study.
- Bulk Generation: Generate large volumes of questions at once.
- Visual Question Generation: Generate questions based on visual data.
- YouTube Integration: Generate questions directly from YouTube content.
- Career Connection: Link educational content to career paths.
- Lesson Planning: Generate structured lesson plans.
- Study Guides: Create comprehensive study guides.
Explore Educhain Use Cases
mainEduchain can be applied to various real-world scenarios, such as:
- Webpage to Quiz: Convert any webpage into a quiz.
- Transcript to Quiz: Generate quizzes from video or audio transcripts.
- PDF Processing: Process long PDF documents into quizzes.
- Multilingual Support: Generate multilingual MCQs (e.g., using Sutra).
- News-based Quizzes: Create quizzes based on the latest news.
- High-Speed Generation: Utilize the 'World's Fastest Quiz' engine.
- Llama4 Integration: Use Llama4 via Groq.
Use different LLMs with LLMConfig
mainEduchain allows you to switch from the default OpenAI model to other LLMs (like Gemini, Claude, or Llama via Groq) by using the
LLMConfigclass.- Initialize your preferred model using a LangChain compatible chat model (e.g.,
ChatGoogleGenerativeAI,ChatAnthropic, orChatOpenAI). - Wrap that model in an
LLMConfig(custom_model=...)object. - Pass the
LLMConfiginstance to theEduchainconstructor.
from educhain import Educhain, LLMConfig from langchain_google_genai import ChatGoogleGenerativeAI # 1. Initialize the model gemini_flash = ChatGoogleGenerativeAI( model="gemini-2.0-flash", google_api_key="YOUR_GOOGLE_API_KEY" ) # 2. Create the config Gemini_config = LLMConfig(custom_model=gemini_flash) # 3. Initialize Educhain with the config client = Educhain(Gemini_config) plan = client.content_engine.generate_study_guide( topic = "Introduction to Programming with Python", difficulty_level = "Beginner" ) plan.show()- Initialize your preferred model using a LangChain compatible chat model (e.g.,
Compare different TTS providers for Educhain
mainChoose a provider based on your project requirements:
Use Case Recommended Provider Testing & Dev google(Free, no setup)AI-Powered/Natural gemini(Latest Gemini 2.5, 30 voices)Production Quality openai(Excellent quality, natural)Professional/Monetized elevenlabs(Best voice quality)Enterprise/Multi-Language azure(400+ voices, 100+ languages)Budget/Open-Source deepinfra(Most affordable, MIT/Apache models)Available Pedagogical Approaches in Educhain
mainEduchain supports 8 distinct pedagogical approaches to guide content generation. The following approaches are available (partial list from guide):
- Bloom's Taxonomy: Used for complete course curriculum design and skill-based training for professionals.
- Socratic Questioning: Ideal for philosophy and ethics courses and developing critical thinking.
- Project-Based Learning (PBL): Designed for STEM education and industry-partnered learning scenarios.
Understand the MCQList and MCQ output format
mainThe output of the question generation engine is an
MCQListobject containing a list ofMCQobjects. EachMCQobject includes the question text, a list of options, the correct answer, and an explanation.MCQList( questions=[ MCQ( question="What is artificial intelligence primarily concerned with?", options=[ "Creating intelligent machines", "Developing faster computers", "Improving internet connectivity", "Designing user interfaces" ], correct_answer="Creating intelligent machines", explanation="Artificial intelligence focuses on creating machines that can perform tasks requiring human-like intelligence." ), # More questions... ] )Compatibility and Breaking Changes in v0.4.0
mainThe migration to LangChain v1.0 in Educhain v0.4.0 introduced the following changes:
Breaking Changes
- Python Support: Python 3.9 is no longer supported. You must use Python 3.10+.
- Dependencies: The
langchain-classicpackage has been removed. If you have it in your environment, it must be uninstalled. - Internal RAG Implementation: The RAG functionality now uses an agent-based pattern instead of the legacy
RetrievalQAchain. This allows for multi-step reasoning and better context understanding.
Backward Compatibility
- Public API: All public API methods, including
generate_questions_with_rag(), have unchanged signatures. - Return Types: All method return types remain the same, ensuring existing code using Educhain will work without modification.
Supported Pedagogies in Educhain Pedagogy
mainThe application supports generating tailored learning experiences using the following pedagogical approaches:
blooms_taxonomy(Blooms Taxonomy)socratic_questioning(Socratic Questioning)project_based_learning(Project Based Learning)flipped_classroom(Flipped Classroom)inquiry_based_learning(Inquiry Based Learning)constructivist(Constructivist)gamification(Gamification)peer_learning(Peer Learning)game_based_learning(Game-Based Learning)
Quickstart Paperfold.ai (Origami Tutorial Generator)
mainPaperfold.ai is an AI-powered web application that generates step-by-step origami folding guides from uploaded images using the
horizon-betamodel via OpenRouter.To run the application locally, follow these steps:
- Clone the repository
- Set up a Python environment (requires Python $\ge$ 3.13).
- Install dependencies (includes
educhain,langchain-openai, andstreamlit). - Configure OpenRouter by obtaining an API key from openrouter.ai.
- Launch the Streamlit app.
Supported OS: macOS, Linux, Windows.
# 1. Clone the repo git clone https://github.com/your-org/paperfold.ai.git cd paperfold.ai # 2. Set up Python (using uv) uv venv source .venv/bin/activate uv pip install -r requirements.txt # 4. Launch locally streamlit run app.pyGetting Started with Educhain Cookbook
mainTo begin using the Educhain cookbook examples, clone the repository, navigate to the cookbook directory, and open the desired Jupyter Notebook (
.ipynb) file in your environment.Setup Steps
- Clone the repository:
git clone https://github.com/satvik314/educhain - Navigate to the cookbook folder:
cd educhain/cookbook - Open any
.ipynbfile in your Jupyter Notebook environment to access specific guides and examples.
git clone https://github.com/satvik314/educhain cd educhain/cookbook- Clone the repository: