A complete example showing how to build a health AI agent with real-time supplement-drug interaction checking using TruthStack.
This agent checks every supplement recommendation against TruthStack's database of 1,008+ interactions, 805 FAERS adverse event signals, and 25 drug profiles — before giving advice.
Health AI agents should not recommend supplements without checking for interactions. A user on blood thinners asking about vitamin K, or someone on SSRIs asking about St. John's Wort — these are real safety risks.
TruthStack provides the safety infrastructure. This repo shows how to use it.
# Already installed? Just configure Claude Desktop:
# ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"truthstack": {
"command": "node",
"args": ["/path/to/truthstack-mcp/index.js"]
}
}
}cd langchain-agent
pip install -r requirements.txt
export TRUTHSTACK_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
python agent.py# Check a supplement stack
curl -X POST https://api.truthstack.co/api/stack/check \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"compounds": ["magnesium", "vitamin D", "lisinopril"]}'
# Search for a compound
curl "https://api.truthstack.co/api/compounds/search?q=ashwagandha" \
-H "x-api-key: YOUR_API_KEY"truthstack-example-health-agent/
├── README.md
├── langchain-agent/
│ ├── agent.py # Full LangChain agent with TruthStack
│ ├── truthstack_toolkit.py # LangChain toolkit (5 tools)
│ └── requirements.txt
├── direct-api/
│ ├── check_stack.py # Simple REST API example
│ ├── check_stack.js # Node.js version
│ └── check_stack.sh # cURL example
└── mcp-config/
└── claude_desktop_config.json # Drop-in MCP config
import requests
API_KEY = "your-truthstack-api-key"
BASE = "https://api.truthstack.co/api"
headers = {"x-api-key": API_KEY}
# Search for a compound
r = requests.get(f"{BASE}/compounds/search", params={"q": "magnesium"}, headers=headers)
print(r.json())
# Check a full stack
r = requests.post(f"{BASE}/stack/check",
json={"compounds": ["magnesium", "vitamin D", "zinc", "lisinopril"]},
headers=headers)
for interaction in r.json().get("data", []):
if interaction["severity"] != "none":
print(f"⚠️ {interaction['compound_a']} ↔ {interaction['compound_b']}: {interaction['severity']}")| Data | Count |
|---|---|
| Directed interactions | 1,008+ |
| FAERS adverse event signals | 805 |
| Research findings | 235 |
| Compounds | 95 |
| Compound aliases | 584 |
| Drug profiles | 25 |
Every interaction includes:
- Severity score (none, low, moderate, high, critical)
- Evidence quality rating
- Mechanism description
- Source (FAERS, PubMed, ClinicalTrials.gov)
| Endpoint | Method | Description |
|---|---|---|
/api/compounds/search?q= |
GET | Fuzzy compound search |
/api/compounds/:id |
GET | Full compound profile |
/api/compounds/:id/interactions |
GET | Compound interactions |
/api/stack/check |
POST | Check entire stack |
/api/drugs/:name |
GET | Drug interaction profile |
/api/stats |
GET | Database statistics |
/api/health |
GET | API health check |
Full docs: api.truthstack.co/docs
Visit api.truthstack.co to get your free API key.
- API Docs: https://api.truthstack.co/docs
- MCP Server: https://github.com/TruthStack1/truthstack-mcp
- Website: https://www.truthstack.co
- Glama.ai: Listed
- RapidAPI: Listed
MIT