Using Agents and Knowledge Graphs
An AI-powered supplement safety advisor that analyzes your complete health profile to deliver personalized, evidence-grounded recommendations.
Introduction
Millions of people take dietary supplements every day - yet most recommendations come from one-size-fits-all lists that ignore your age, medications, existing conditions, and lifestyle. What's beneficial for one person can be harmful or redundant for another.
Our project addresses this gap by building a system that treats you as an individual. By combining a rich health knowledge graph with a multi-agent AI workflow, we can reason about your entire health profile and surface recommendations that are safe, relevant, and evidence-backed.
Most supplement guides ignore interactions with medications, pre-existing conditions, and individual nutritional gaps.
Symptoms, nutrients, and conditions form a complex web. A knowledge graph lets us reason across these relationships.
Agentic AI workflows can plan, verify safety, and synthesize a holistic answer - not just pattern-match keywords.
Data & Knowledge Graph
At the core of our system is a Neo4j knowledge graph that encodes relationships between supplements, nutrients, health conditions, symptoms, and medications. Rather than querying a flat table, our agents traverse this graph to understand why a recommendation makes sense.
Relational databases can't easily express multi-hop relationships. A graph lets us ask: "Which supplements help with heart health, are safe with metformin, and don't overlap with this person's current vegan diet?"
We use Neo4j as our graph database, with Cypher queries executed dynamically by agents during a live recommendation session.
A user on Warfarin asks about heart health supplements. The graph surfaces CoQ10 and fish oil as common recommendations, immediately flags dangerous interactions with Warfarin through multi-hop paths, and suggests flaxseed oil as the safest alternative - all traced through explicit graph relationships.
System Architecture
Our system uses a LangGraph multi-agent workflow where a central orchestrator decomposes your health query, dispatches specialized agents in parallel, and synthesizes their findings into a single personalized response. Built with LangGraph for stateful agent orchestration, Claude as the underlying LLM for each agent, and Neo4j Cypher queries for real-time graph traversal during each recommendation session.
schema.py and dynamically generates Cypher queries to map extracted entities to database IDs. Produces normalized medications_list, supplements_list, and dietary_restrictions_list.Evaluation
We tested the system with 62 golden-set test cases — real health scenarios with known correct answers verified against our knowledge graph. Every test ran through the full multi-agent pipeline and was manually rated.
| Test Suite | Tests | Correct | Partial | Accuracy |
|---|---|---|---|---|
| Safety Check | 22 | 17 | 5 | 77% |
| Deficiency Check | 12 | 12 | 0 | 100% |
| Recommendation | 15 | 10 | 5 | 67% |
| Multi-Agent (E2E) | 13 | 11 | 2 | 85% |
The system is strongest where it matters most - safety. It detected every known supplement-medication conflict including Fish Oil with Warfarin, CoQ10 with Metformin, and Aloe with Warfarin. Deficiency detection works across all three pathways (diet, medication, supplement) and correctly identifies compounded risks when multiple sources affect the same nutrient. The 12 partial results all trace to knowledge graph coverage gaps for common conditions (joint pain, fatigue, headaches) or minor data quality issues - not to the system giving dangerous advice.
Discussion
Resources