How abdurrahim2705/rag-chatbot works
Sunrise Learning Academy provides a student login API and a course-advisor chat API. Login checks credentials against PostgreSQL; chat retrieves catalog passages from Pinecone and sends them with the question to a Hugging Face model. A separate ingestion script reads the course catalog, embeds its paragraphs, and uploads them to Pinecone. The README is empty, so the map reflects the sampled source; external service relationships are shown where those calls are explicit.
Main entry points: rag.py Chat answer flow · ingest.py Catalog ingestion · main.py FastAPI endpoints · database.py Login verification
Components 10
API
- FastAPI endpoints
main.py - Login verification
database.py
Knowledge ingestion
- Course catalog
course_catalog.md - Catalog ingestion
ingest.py
Chat retrieval
- Chat answer flow
rag.py
External services
- PostgreSQL
- SentenceTransformer
- Pinecone index
- Hugging Face inference
Other components
- Student
Connections 10
- Student → FastAPI endpoints: sends requests
main.py - FastAPI endpoints → Login verification: verifies login
main.py - Login verification → PostgreSQL: queries students
database.py - FastAPI endpoints → Chat answer flow: gets answer
main.py - Catalog ingestion → Course catalog: reads catalog
ingest.py - Catalog ingestion → SentenceTransformer: encodes paragraphs
ingest.py - Catalog ingestion → Pinecone index: upserts vectors
ingest.py - Chat answer flow → SentenceTransformer: encodes question
rag.py - Chat answer flow → Pinecone index: queries matches
rag.py - Chat answer flow → Hugging Face inference: requests answer
rag.py