LangChain
SequentialChainpipeline — loads a PDF, summarizes to bullet points, then auto-generates 5 MCQ quiz questions. No vector DB required.
🎓 Part of the Analytics Vidhya GenAI Pinnacle Plus Program
A two-stage LangChain pipeline where Chain 1 summarizes study material and Chain 2 generates quiz questions from that summary. Demonstrates the SequentialChain pattern — the output of one LLM chain automatically feeds the next.
| Layer | Technology |
|---|---|
| LLM Orchestration | LangChain (LLMChain, SequentialChain, PromptTemplate) |
| LLM | OpenAI GPT-3.5-turbo |
| PDF Parsing | PyPDF2 |
6th langchain agentic AI/
├── study_assistant_quiz_generator.ipynb ← Main notebook
├── Prompt Engineering.pdf ← Sample study material
└── README.md
pip install PyPDF2 langchain langchain-openai openaiSet your OpenAI API key:
os.environ["OPENAI_API_KEY"] = "sk-..."PDF file
↓ PyPDF2 (extract text, truncate to 4000 chars)
↓
Chain 1 — SummaryChain
LLM role: "expert educator"
Output: 5-8 bullet-point summary
↓
Chain 2 — QuizChain
LLM role: "expert quiz creator"
Output: 5 MCQs (a/b/c/d + correct answer)
Orchestrator: SequentialChain (verbose=True)
Summary:
- Prompt engineering refines inputs to language models for better output control.
- Zero-shot prompting uses general knowledge without task-specific examples.
- Few-shot prompting provides examples to guide model performance.
- Chain-of-Thought breaks complex tasks into intermediate reasoning steps.
Quiz Question:
1. Which technique provides examples to guide model output?
a) Zero-shot prompting
b) Few-shot prompting ✓
c) Chain-of-Thought
d) Role playing
PromptTemplate— parameterized prompt construction withinput_variablesLLMChain— bind a prompt to an LLM and give the output a keySequentialChain— pipe multiple chains where output of one = input of nextoutput_key— controls how results flow between chains- Context window management — truncating PDF text to 4,000 chars
This project is Assignment 6 of the Analytics Vidhya GenAI Pinnacle Plus Program — LangChain Agentic AI module, first LLM orchestration project.
MIT © 2026 sujitchan431