abdullah9873/physical-ai-backend
0
Backend README
This is the README for the RAG Chatbot backend service.
Setup
- Prerequisites:
- Python 3.11+ installed
requirements.txtfile with all necessary dependencies- Environment variables configured (
OPENAI_API_KEY,QDRANT_API_KEY,QDRANT_HOST,DATABASE_URL)
- Installation:
pip install -r requirements.txt- Database Setup: (Assuming Alembic is used for migrations)
alembic upgrade head(If not using Alembic, refer to `backend/src/database.py` for connection details and manual setup if needed)
- Running the Server:
uvicorn backend.src.main:app --reloadUsage
- The API provides two main endpoints:
POST /query/general: For general questions about the book.POST /query/selected-text: For questions about specific text selections.
Data Ingestion
To populate the database and vector store, run the ingestion script:
python scripts/ingest_data.pyNote: Ensure your Docusaurus build output is accessible at the path specified in `scripts/ingest_data.py` or modify the script to point to the correct location.
