cd code python -m venv .venv
Windows: .venv\Scripts\activate Linux/Mac: source .venv/bin/activate
pip install -r requirements.txt
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"
To generate the test_predict.jsonl file: cd code python generate_test_submission.py
{"id": "query-id", "answer": "generated answer"} Expected runtime: ~10-15 minutes for full test set (depends on GPU)
To explore the three RAG modes interactively: cd code python web_ui.py
Then open: http://localhost:5000
Available modes:
⚡ Basic RAG: Simple Q&A without memory 🔄 MultiTurn RAG: Conversation with memory & query reformulation (Feature A) 🧠 Agentic Workflow: Multi-step reasoning with decomposition (Feature B)
Python 3.11.12 (Required)
Deep Learning & Transformers:
torch==2.5.1 (install separately with CUDA/CPU flag)transformers==4.47.1 - Transformer models (ColBERT, E5, all generators)accelerate==1.2.1 - Model accelerationpeft==0.14.0 - Parameter-efficient fine-tuning (LoRA for finetune_qwen.py)bitsandbytes==0.45.0 - 8-bit optimizers (GPU only, used in finetune_qwen.py)safetensors==0.4.5 - Safe tensor serializationLangChain & LangGraph (Required for ALL generators):
langchain==0.3.13 - LangChain framework (BasicRAG, MultiTurnRAG, AgenticRAG)langchain-core==0.3.28 - LangChain core components (prompts, messages, base classes)langchain-community==0.3.13 - LangChain community integrationslanggraph==0.2.59 - LangGraph state graphs (MultiTurnRAG, AgenticRAG workflows)langchain-huggingface==0.1.2 - HuggingFace pipeline integration (all generators)langsmith==0.2.5 - LangSmith for tracing and debuggingEmbeddings & Retrieval:
sentence-transformers==3.3.1 - Sentence embedding models (Dense, E5, ColBERT retrievers)rank-bm25==0.2.2 - BM25 ranking algorithm (BM25 retriever)faiss-cpu==1.9.0.post1 - Vector similarity search (E5 retriever)gensim==4.3.3 - Word2Vec and topic modeling (Word2Vec retriever)NLP Utilities:
nltk==3.9.1 - Natural Language Toolkit (all retrievers use this)Web Framework (for web_ui.py):
Flask==3.1.0 - Web framework for web UIWerkzeug==3.1.3 - WSGI utilities for FlaskJinja2==3.1.4 - Template engine for FlaskMarkupSafe==3.0.2 - Safe string handling for templatesData Processing & ML:
numpy==1.26.4 - Numerical computing (all retrievers, evaluate.py)pandas==2.2.3 - Data manipulationscikit-learn==1.5.2 - Machine learning utilities (Dense, E5, Word2Vec, answer_validator.py)datasets==3.2.0 - HuggingFace datasets (finetune_qwen.py)Utilities:
tqdm==4.67.1 - Progress bars (evaluate.py, finetune_qwen.py)requests==2.32.5 - HTTP libraryhuggingface-hub==0.27.0 - HuggingFace Hub clienttokenizers==0.21.0 - Fast tokenizersfilelock==3.20.0 - File lockingfsspec==2024.10.0 - Filesystem specregex==2024.11.6 - Regular expressionsPyYAML==6.0.2 - YAML parserpackaging==24.2 - Package version utilitiesMinimum Requirements:
Recommended Setup:
For GPU Support:
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121
If Dependencies Conflict: pip install --upgrade pip pip install -r requirements.txt --upgrade
Complete Installation Commands: GPU with CUDA 12.1: pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"
Key Files: generate_test_submission.py: Main script for reproducing test_predict.jsonl web_ui.py: Interactive web interface for exploring RAG modes requirements.txt: Complete list of dependencies with versions data/e5_embeddings.npz: Pre-computed embeddings (used by generate_test_submission.py) models/finetuned-qwen-1.5b/: Fine-tuned model weights
Configuration: The submission script uses: Retriever: E5MistralRetriever (intfloat/e5-large-v2 with pre-computed embeddings) Generator: Fine-tuned Qwen 1.5B with LoRA adapters Few-shot: 10 examples from train.jsonl Top-k: 15 documents per query Temperature: 0.2
The system uses a fine-tuned Qwen 1.5B model which has limitations for complex entity disambiguation MultiTurn RAG (Feature A) maintains conversation memory via Flask sessions Agentic Workflow (Feature B) implements query decomposition, retrieval, synthesis, verification, and reflection steps For best results on simple questions, use Basic RAG mode; for follow-up questions, use MultiTurn mode
cd code python -m venv .venv
Windows: .venv\Scripts\activate Linux/Mac: source .venv/bin/activate
pip install -r requirements.txt
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"
To generate the test_predict.jsonl file: cd code python generate_test_submission.py
{"id": "query-id", "answer": "generated answer"} Expected runtime: ~10-15 minutes for full test set (depends on GPU)
To explore the three RAG modes interactively: cd code python web_ui.py
Then open: http://localhost:5000
Available modes:
⚡ Basic RAG: Simple Q&A without memory 🔄 MultiTurn RAG: Conversation with memory & query reformulation (Feature A) 🧠 Agentic Workflow: Multi-step reasoning with decomposition (Feature B)
Python 3.11.12 (Required)
Deep Learning & Transformers:
torch==2.5.1 (install separately with CUDA/CPU flag)transformers==4.47.1 - Transformer models (ColBERT, E5, all generators)accelerate==1.2.1 - Model accelerationpeft==0.14.0 - Parameter-efficient fine-tuning (LoRA for finetune_qwen.py)bitsandbytes==0.45.0 - 8-bit optimizers (GPU only, used in finetune_qwen.py)safetensors==0.4.5 - Safe tensor serializationLangChain & LangGraph (Required for ALL generators):
langchain==0.3.13 - LangChain framework (BasicRAG, MultiTurnRAG, AgenticRAG)langchain-core==0.3.28 - LangChain core components (prompts, messages, base classes)langchain-community==0.3.13 - LangChain community integrationslanggraph==0.2.59 - LangGraph state graphs (MultiTurnRAG, AgenticRAG workflows)langchain-huggingface==0.1.2 - HuggingFace pipeline integration (all generators)langsmith==0.2.5 - LangSmith for tracing and debuggingEmbeddings & Retrieval:
sentence-transformers==3.3.1 - Sentence embedding models (Dense, E5, ColBERT retrievers)rank-bm25==0.2.2 - BM25 ranking algorithm (BM25 retriever)faiss-cpu==1.9.0.post1 - Vector similarity search (E5 retriever)gensim==4.3.3 - Word2Vec and topic modeling (Word2Vec retriever)NLP Utilities:
nltk==3.9.1 - Natural Language Toolkit (all retrievers use this)Web Framework (for web_ui.py):
Flask==3.1.0 - Web framework for web UIWerkzeug==3.1.3 - WSGI utilities for FlaskJinja2==3.1.4 - Template engine for FlaskMarkupSafe==3.0.2 - Safe string handling for templatesData Processing & ML:
numpy==1.26.4 - Numerical computing (all retrievers, evaluate.py)pandas==2.2.3 - Data manipulationscikit-learn==1.5.2 - Machine learning utilities (Dense, E5, Word2Vec, answer_validator.py)datasets==3.2.0 - HuggingFace datasets (finetune_qwen.py)Utilities:
tqdm==4.67.1 - Progress bars (evaluate.py, finetune_qwen.py)requests==2.32.5 - HTTP libraryhuggingface-hub==0.27.0 - HuggingFace Hub clienttokenizers==0.21.0 - Fast tokenizersfilelock==3.20.0 - File lockingfsspec==2024.10.0 - Filesystem specregex==2024.11.6 - Regular expressionsPyYAML==6.0.2 - YAML parserpackaging==24.2 - Package version utilitiesMinimum Requirements:
Recommended Setup:
For GPU Support:
pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121
If Dependencies Conflict: pip install --upgrade pip pip install -r requirements.txt --upgrade
Complete Installation Commands: GPU with CUDA 12.1: pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"
Key Files: generate_test_submission.py: Main script for reproducing test_predict.jsonl web_ui.py: Interactive web interface for exploring RAG modes requirements.txt: Complete list of dependencies with versions data/e5_embeddings.npz: Pre-computed embeddings (used by generate_test_submission.py) models/finetuned-qwen-1.5b/: Fine-tuned model weights
Configuration: The submission script uses: Retriever: E5MistralRetriever (intfloat/e5-large-v2 with pre-computed embeddings) Generator: Fine-tuned Qwen 1.5B with LoRA adapters Few-shot: 10 examples from train.jsonl Top-k: 15 documents per query Temperature: 0.2
The system uses a fine-tuned Qwen 1.5B model which has limitations for complex entity disambiguation MultiTurn RAG (Feature A) maintains conversation memory via Flask sessions Agentic Workflow (Feature B) implements query decomposition, retrieval, synthesis, verification, and reflection steps For best results on simple questions, use Basic RAG mode; for follow-up questions, use MultiTurn mode