Knowval AI is an intelligent Knowledge Evaluator Agent designed to assess a user's understanding of specific topics using RAG (Retrieval-Augmented Generation). It ingests educational materials, generates dynamic quizzes, and evaluates answers using Bloom's Taxonomy.
- RAG-based Knowledge Retrieval: Ingests documents to create a knowledge base using ChromaDB.
- Enhanced Ingestion Support:
- Formats: PDF, TXT, DOCX, ZIP, TAR, TAR.GZ.
- Images: PNG, JPG, JPEG (requires Tesseract OCR).
- Multilevel Quiz Modes:
- Single Shot: Random questions from the entire document.
- Multilevel: Discovers topics/chapters and generates focused quizzes.
- Dynamic Question Generation:
- Smart Deduplication: Uses fuzzy matching and MMR (Max Marginal Relevance) for diverse, non-repetitive questions.
- Dynamic Sizing: Automatically adjusts quiz length (10/20/30 questions) based on document size.
- Difficulty Levels: Supports Easy, Medium, and Hard difficulty settings.
- Intelligent Evaluation:
- Bloom's Taxonomy: Evaluates answers based on cognitive depth.
- Context Awareness: Checks relevance to the source material.
- Keyword Matching: Verifies the presence of essential concepts.
- Interactive Chatbot: A CLI-based interactive loop for taking quizzes and receiving immediate feedback.
- Performance Reporting: Provides a final score and detailed review of incorrect answers.
-
Clone the repository:
git clone https://github.com/yourusername/knowlEval.git cd knowlEval -
Install dependencies:
pip install -r requirements.txt
-
Set up Environment Variables:
- Create a
.envfile in the root directory. - Add your OpenAI API Key:
OPENAI_API_KEY=your_api_key_here
- Create a
-
Start the Agent:
python main.py
-
Ingest Documents:
- Enter the file paths of your study materials when prompted.
- Supports:
.pdf,.txt,.docx,.zip,.tar,.png,.jpg, etc. - Example:
/path/to/docs.zipor/path/to/notes.docx
-
Select Quiz Mode:
- Single Shot: For a general assessment of the entire content.
- Multilevel: To discover topics and focus on specific chapters.
-
Take the Quiz:
- Answer the generated MCQs.
- Receive real-time scoring and feedback.
-
Review:
- Get a comprehensive report at the end of the session.
- Push this repository to GitHub.
- Go to Streamlit Community Cloud.
- Connect your GitHub account and select this repository.
- Set the Main file path to
app.py. - Advanced Settings:
- Add your
OPENAI_API_KEYin the "Secrets" section. - Note: The repository includes
packages.txtto automatically install Tesseract OCR.
- Add your
main.py: Entry point for the interactive chatbot loop.ingestion.py: Handles document loading (including archives/images), chunking, and vector storage.generator.py: Generates unique questions using LLMs with MMR search and dynamic sizing.topic_discovery.py: Identifies topics for Multilevel quizzes.evaluator.py: Evaluates user answers and provides feedback.test_verification.py: Automated script to verify the pipeline.
- Python 3.11+
- LangChain: For orchestration and RAG flows.
- ChromaDB: Vector database for document storage.
- OpenAI GPT-4o: LLM for generation and evaluation.
- Tesseract OCR: For extracting text from images.