A Multi-Agent RAG System for Personalised Wellness Guidance
An autonomous, evidence-based AI assistant for functional & holistic health.
Built using GPT-3.5, PubMed, and a modular multi-agent system.
Purpose
The goal of this project is to build an autonomous multi-agent AI system that provides accurate, evidence-based, and personalized answers to user questions related to holistic health. It leverages structured LLM workflows and retrieval-augmented generation (RAG), categorizes queries, and routes them to expert agents specialising in areas like nutrition, detox, and sleep.
What’s Missing in Today’s Solutions
Most digital health assistants provide general information without understanding the context or categorising the user's needs. They often rely on static databases or keyword matching, which limits their ability to generate tailored responses. Moreover, they rarely use external scientific sources like PubMed in real time.
This project addresses those gaps by:
Using OpenAI models to understand user intent and classify health topics,
Routing the query to specialised expert agents with their own semantic search,
Enriching answers with real-time scientific data from PubMed,
Combining insights through a multi-agent collaborative workflow.
As a result, users receive answers that are both personalised and scientifically grounded, with a focus on functional medicine and holistic health rather than conventional allopathic approaches.
Architecture Overview
The system follows a modular, multi-agent design:
User Query
Categorisation Agent (GPT-3.5)
Specialised Agents (FAISS + PubMed + GPT-3.5)
Synthesis Agent (GPT-3.5)
Final Personalised Response
Health Categories & Knowledge Sources
Agents:
Nutrition
Herbal Remedies
Sleep & Circadian Rhythm
Mental Health
Detox
Hormone Health
Sources:
Curated holistic health facts
Real-time PubMed abstracts via Entrez API
Each agent uses a FAISS vector index enriched with category-specific documents and PubMed abstracts.
Data Sources & Processing
This project integrates two types of knowledge sources:
1. Domain-Specific Knowledge Base
Each agent is equipped with a curated set of facts relevant to its category. These include insights from functional medicine, naturopathy, and holistic health—manually selected based on scientific and traditional knowledge.
For example:
The Nutrition Agent uses facts about intermittent fasting, omega-3 benefits, and blood sugar balance.
The Hormone Health Agent includes content about seed cycling, estrogen dominance, and cortisol imbalances.
2. PubMed Abstracts via Entrez API
To ensure scientific grounding, the system enriches agent documents by retrieving live abstracts from PubMed for each category.
Process:
For each health category, the system queries PubMed using the category name.
Top abstracts are fetched and appended to that agent’s knowledge base.
These new entries are automatically embedded into the agent’s FAISS index for semantic retrieval.
This hybrid approach of combining hand-crafted expertise with real-time scientific data ensures each response is both practical and evidence-based.
LLM Workflow & Synthesis
GPT-3.5 categorizes user intent
Each agent runs semantic retrieval + GPT-based generation
Final answers are synthesized
Evaluation & Metrics
As this project is currently in its early prototype stage, formal evaluation metrics such as F1-score, accuracy, or human preference ratings have not yet been applied.
However, qualitative assessment has been performed through:
Real-world test queries from functional medicine and holistic health domains
Manual verification of response coherence, relevance, and scientific grounding
Diversity of answers across multiple categories
Planned future evaluation includes:
User feedback integration directly from the Streamlit interface
Comparison with standard RAG baselines using biomedical QA benchmarks
Tracking response latency and relevance for multi-agent synthesis
We aim to introduce lightweight user scoring and feedback collection tools to improve responses and personalize the experience over time.
Deployment & Maintenance
The application is deployed using Streamlit Cloud, enabling a fully interactive web-based interface without server configuration.
Deployment Stack:
Frontend: Streamlit
Backend: Python (single app.py)
LLM APIs: OpenAI GPT-3.5 via secure API key stored in Streamlit Secrets
Vector Search: FAISS with SentenceTransformers (MiniLM-L6-v2)
Realtime Data: PubMed abstracts fetched via Entrez API
Maintenance Notes:
Secrets (API key) are securely stored in Streamlit and never exposed in the codebase.
No persistent database is used; data is fetched or generated dynamically at runtime.
The system is stateless except for optional session-based memory with st.session_state.
Interface Preview
Here’s how a sample query is processed through multiple health agents:
Limitations & Future Work
Known Limitations
No Long-Term Memory: While st.session_state provides basic session memory, there is no persistent memory or user profiling across sessions.
Limited Dataset Scope: The knowledge base includes handpicked facts and PubMed abstracts, but may miss broader or newer holistic health insights.
No Feedback Loop: The system does not currently incorporate user feedback to improve answers or model performance.
Single Language Support: The assistant only supports English queries and responses.