A RAG AI Chatbot designed for exploring textbooks and educational materials. The application includes OpenStax High School Physics as a default document and allows users to upload additional documents for AI context. Built with FastAPI backend and Streamlit frontend, organized in api and app directories.
This application comes pre-loaded with OpenStax High School Physics textbook, which is licensed under Creative Commons Attribution License 4.0 (CC BY 4.0) by Texas Education Agency (TEA). The content is used for educational purposes and proper attribution should be maintained throughout the application.
- Source: OpenStax High School Physics
- Provider: Texas Education Agency (TEA)
- License: Creative Commons Attribution License v4.0
- Usage: Content is used for educational purposes through AI-assisted retrieval and generation
- Create a
.envfile using the provided exampleFAST_API_URLis only required for production (defaults to localhost:8000)- Set a secure
ADMIN_TOKENto enable default document deletion - External APIs can be tested using
tests/hello_openai.py
Install dependencies from requirements.txt:
pip install -r requirements.txt- Start FastAPI Backend:
uvicorn api.main:app --reload- Start Streamlit Frontend:
streamlit run app/streamlit_app.py- FastAPI Documentation:
http://127.0.0.1:8000/docs - Streamlit Interface:
http://localhost:8501
# Build
pip install -r requirements.txt
# Start
uvicorn api.main:app --host 0.0.0.0 --port $PORT# Build
pip install -r requirements.txt
# Start
streamlit run app/streamlit_app.py --server.port $PORT --server.address 0.0.0.0Note: Deploy as two separate services on render - backend API and frontend
A local script is provided for document management:
- Upload default documents
- Delete any document (including defaults)
- List all documents
- Upload custom documents
python admin_tools.pyThis project combines multiple licenses:
- Application Code: MIT License
- Default Content: Creative Commons Attribution License 4.0 (CC BY 4.0)
- When using content from the default OpenStax textbook, proper attribution must be maintained
For more information about the CC BY 4.0 license, visit the official license deed.