The Agentic RAG Fitness Chatbot is an AI-powered application designed to provide personalized fitness guidance and workout recommendations. Uses Retrieval-Augmented Generation (RAG), multi-agent systems, and a curated knowledge base, to deliver context-aware and actionable fitness advice. The chatbot focuses on empowering beginners with evidence-based fitness recommendations, real-time video demonstrations, and safety guidelines.
The LangGraph Workflow outlines the sequence of nodes in the system’s architecture. Each node represents a specific function, from query handling to generating responses. Below is the compiled workflow:
The system consists of the following components:
- User Input: Accepts user queries through a Streamlit-based chat interface.
- Query Refinement: Transforms user input into an optimized format using an LLM-based query rewriting mechanism.
- Retrieval System:
- Encodes user queries using Sentence Transformers.
- Queries the Pinecone vector database to fetch relevant fitness data.
- Retrieves video demonstrations and transcripts.
- Response Generation: Synthesizes retrieved information using GPT-4o, ensuring the response is actionable and grounded in context.
- Video Recommendations: Displays video thumbnails, titles, and links alongside detailed transcripts.
- Langsmith Integration: Tracks agent-level decisions and improves overall system reliability.
To provide transparency and insights into the system's behavior, the Langsmith trace and LangGraph workflow have been visualized:
The Langsmith Trace captures the flow of the chatbot’s decision-making process, including tool calls and their respective responses. Below is an example trace showcasing a user query and the system's response:
- Clone the repository:
git clone https://github.com/pramod-zillella/AgenticRagChatbot.git cd agentic-rag-fitness-chatbot
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.env
file in the project directory. - Add your API keys:
OPENAI_API_KEY=your_openai_api_key PINECONE_API_KEY=your_pinecone_api_key LANGCHAIN_API_KEY_V2=your_langchain_api_key
- Create a
- Run the Streamlit application:
streamlit run interface.py
- Predefined Questions: Select from common fitness-related queries or type your own.
- Custom Queries: Ask personalized questions about workouts, nutrition, or injury prevention.
- Interactive Recommendations: View suggested video demonstrations and detailed response within the chat interface.