How abdallahelraey/fitness-chatbot works
AI Personal Coach combines document-grounded fitness chat with user profiles, fitness assessments, and API-backed authentication. The primary flow is a user query through the chat interface/API, retrieval from prepared fitness documents, then personalized response generation using conversation memory and an LLM. Document ingestion and assessment reporting are distinct supporting workflows. The route, viewer, configuration, and assessment-phase implementations were not sampled, so their internal wiring is shown only where supported by the README or sampled callers.
Main entry points: BaseDataModel.py RAG data model · main.py FastAPI app · ProcessController.py Query processing · LoginResponseParser.py Login parsing
Components 21
Interfaces and API
- FastAPI app
main.py - Chat interfaces
src/viewers - Chat route
src/routes/Chatbot.py - Data routes
src/routes/data.py - Base routes
src/routes/base.py
Knowledge and Chat
- Fitness documents
src/assets/files - Document handling
src/controllers/DocumentController.py - Query processing
src/controllers/ProcessController.py - RAG data model
src/models/BaseDataModel.py - Chroma index
src/assets/chroma - Conversation memory
src/controllers/ProcessController.py
User and Assessments
- User profile
src/models/UserData/UserProfile.py - Assessment manager
src/controllers/AssessmentManager.py - Assessment phases
src/models/OPTAssessments - Assessment reporting
src/routes/AssessmentService.py - Login parsing
src/routes/LoginResponseParser.py
External Services
- Embedding model
- Groq LLM
- Authentication service
- Assessment endpoint
Other components
- User
Connections 20
- User → Chat interfaces: asks fitness question
- User → FastAPI app: uses API
- Chat interfaces → FastAPI app: sends chat request
- FastAPI app → Chat route: dispatches chat
- FastAPI app → Data routes: dispatches data
- FastAPI app → Base routes: dispatches base
- Chat route → Query processing: processes query
- Data routes → Document handling: handles documents
- Query processing → RAG data model: loads and searches
- RAG data model → Fitness documents: reads documents
- RAG data model → Chroma index: upserts and queries
- RAG data model → Embedding model: embeds content
- Query processing → Conversation memory: reads and updates
- Query processing → Groq LLM: invokes model
- RAG data model → Login parsing: requests login
- Login parsing → Authentication service: posts credentials
- Assessment manager → Assessment phases: runs assessments
- Assessment reporting → Assessment endpoint: posts scores
- Assessment reporting → Login parsing: parses response
- User profile → Assessment manager: supplies user data