CoolFace
Apppublic

sanadf234/StudyAssitBackend

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

Study Helper Backend

A minimal RAG backend using FastAPI and Groq for embeddings and generation.

Setup

  1. 1.Create a virtual environment in the workspace if not already created:
powershell
   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
  1. 1.Add your Groq API key to .env:
text
   GROQ_API_KEY=your_groq_api_key_here

Run

powershell
cd backend
..\.venv\Scripts\uvicorn.exe main:app --reload --host 0.0.0.0 --port 8000

API Endpoints

  • —GET / — health check
  • —POST /ingest — ingest documents
  • —POST /query — query the RAG system

Example Payloads

Ingest

json
{
  "documents": [
    {
      "title": "Biology Overview",
      "text": "Cells are the basic units of life.",
      "metadata": {"topic": "biology"}
    }
  ]
}

Query

json
{
  "query": "What is a cell?",
  "max_context": 2
}