HarikaSeshaMani/vocab_arena
๐ค AI Teaching Assistant
An intelligent, adaptive teaching assistant powered by Groq LLaMA, Sentence Transformers, and the YouTube Data API. It supports CAT, IPMAT, and CLAT aspirants by analyzing student queries, detecting intent and difficulty level, generating personalized explanations, and building a custom learning path with real video resources.
๐๏ธ Project Structure
project-root/
โโโ main.py # FastAPI entry point
โโโ app.py # Streamlit frontend
โโโ .env # Environment variables (not committed)
โโโ app/
โ โโโ __init__.py
โ โโโ api/
โ โ โโโ health.py # Health check endpoint
โ โ โโโ query.py # /analyze-query and /full-analysis endpoints
โ โ โโโ learning_path.py # /learning-path endpoint
โ โโโ core/
โ โ โโโ config.py # Pydantic settings / .env loader
โ โโโ models/
โ โ โโโ schemas.py # All Pydantic data models
โ โโโ services/
โ โโโ nlp_service.py # Intent + difficulty detection via MiniLM + Groq
โ โโโ learning_path_service.py # Explanation + path generation + YouTubeโ๏ธ Prerequisites
- Python 3.10+
- Node.js (not required unless generating docs)
- A Groq API key
- A YouTube Data API v3 key (optional)
๐ Setup Instructions
1. Clone the Repository
git clone https://github.com/harikakota04/student-assist
cd student-assist2. Create and Activate a Virtual Environment
# macOS / Linux
python -m venv venv
source venv/bin/activate
# Windows
python -m venv venv
venv\Scripts\activate3. Install Dependencies
pip install -r requirements.txtYour requirements.txt should include:
fastapi
uvicorn
pydantic-settings
groq
sentence-transformers
httpx
streamlit
requests4. Configure Environment Variables
Create a .env file in the project root:
GROQ_API_KEY=your_groq_api_key_here
YOUTUBE_API_KEY=your_youtube_api_key_here # optional
LLM_MODEL=llama-3.3-70b-versatile
MODEL_NAME=all-MiniLM-L6-v2โ ๏ธ Never commit your.envfile. Add it to.gitignore.
โถ๏ธ Running the Application
You need two terminals open at the same time.
Terminal 1 โ Start the FastAPI Backend
uvicorn app.main:app --reload --port 8000Confirm it's running by visiting: http://localhost:8000/docs
You should see the Swagger UI with all available endpoints.
Terminal 2 โ Start the Streamlit Frontend
streamlit run app.pyThe app will open automatically in your browser at http://localhost:8501.
๐ API Endpoints
Example Request โ /api/full-analysis
curl -X POST http://localhost:8000/api/full-analysis \
-H "Content-Type: application/json" \
-d '{
"query": "I am confused about backpropagation",
"student_id": "student_001",
"previous_topics": ["Neural Networks", "Gradient Descent"]
}'๐ง Intent Types Detected
๐ Troubleshooting
"Cannot connect to backend" Make sure FastAPI is running on port 8000 before clicking the button in Streamlit.
"model_decommissioned" error Update LLM_MODEL in your .env file to llama-3.3-70b-versatile and restart the backend.
No YouTube videos showing Add a valid YOUTUBE_API_KEY to your .env. Without it, fallback search links are shown instead.
Slow first load The all-MiniLM-L6-v2 model is downloaded on first use (~90MB). Subsequent starts are fast.
๐ License
This project was built as part of the ThinkPlus AI/ML Engineer Assignment.
