sanadf234/StudyAssitBackend
0
Study Helper Backend
A minimal RAG backend using FastAPI and Groq for embeddings and generation.
Setup
- Create a virtual environment in the workspace if not already created:
python -m venv .venv
d:/Projects/Study-helper/.venv/Scripts/python.exe -m pip install --upgrade pip
d:/Projects/Study-helper/.venv/Scripts/python.exe -m pip install -r requirements.txt- Add your Groq API key to
.env:
GROQ_API_KEY=your_groq_api_key_hereRun
cd backend
..\.venv\Scripts\uvicorn.exe main:app --reload --host 0.0.0.0 --port 8000API Endpoints
GET /— health checkPOST /ingest— ingest documentsPOST /query— query the RAG system
Example Payloads
Ingest
{
"documents": [
{
"title": "Biology Overview",
"text": "Cells are the basic units of life.",
"metadata": {"topic": "biology"}
}
]
}Query
{
"query": "What is a cell?",
"max_context": 2
}