A Streamlit-based personal fitness app that leverages Langflow to provide tailored macro-nutritional advice and guidance. This tool manages users' personal fitness profiles and goals, generates dietary recommendations using AI, and stores notes and profiles in an Astra database.
The Personal Fitness Tool provides a centralized platform for users to manage fitness-related information and receive AI-powered recommendations. With Langflow, the AI model dynamically processes inputs like user goals and personal data, giving actionable suggestions on nutrition and training. This tool employs Astra’s NoSQL database to store user data securely and efficiently.
- Macros Generation: Utilize Langflow-powered AI to generate dietary macros based on users' fitness goals.
- Notes Management: Save, retrieve, and delete fitness notes.
- Ask AI: Use language models to answer custom user questions based on their stored fitness profile and notes.
The following architecture is set up for efficient communication between the Streamlit interface, Langflow’s model interactions, and the Astra database.
- Python 3.10+
- Streamlit for UI (
pip install streamlit
) - Langflow setup and environment variable for API (
LANGFLOW_TOKEN
) - Astra DB credentials (
ASTRA_ENDPOINT
andASTRA_DB_APPLICATION_TOKEN
in.env
file)
-
Clone the repository:
git clone https://github.com/JohnNixon6972/Python-Multi-Agent cd Python-Multi-Agent
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables by creating a
.env
file and adding the following:LANGFLOW_TOKEN=<Your Langflow Token> ASTRA_ENDPOINT=<Your Astra DB Endpoint> ASTRA_DB_APPLICATION_TOKEN=<Your Astra Token> OPENAI_API_KEY=<Your OpenAI API Key>
-
Initialize the database collections using
db.py
. -
Run the Streamlit app:
streamlit run main.py
- Personal Data: Fill out your name, age, weight, height, gender, and activity level, then click "Save" to update your profile.
- Goals: Select and save personal fitness goals.
- Macros: Generate dietary macros using AI or input your values.
- Notes: Manage and store custom notes related to fitness.
- Ask AI: Input questions for the AI to provide customized responses.
Langflow orchestrates the interactions between different models to enable personalized user guidance. By configuring flows within Langflow, models can respond accurately based on user-specific data, such as profile and goals, enabling adaptive recommendations. The AI flow files for Ask AI
and Macros Generation
are customized and stored as JSON files within the Langflow console.