Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Health Agent — Discord Bot

A personal health advisor that lives in your Discord server. Tracks symptoms, manages your supplement stack, researches topics on demand, and proactively surfaces longevity research weekly.


Step 1 — Create your Discord Bot

  1. Go to https://discord.com/developers/applications
  2. Click New Application → name it "Health Agent"
  3. Go to Bot (left sidebar) → click Add Bot
  4. Under Token → click Reset Token → copy it (you only see it once)
  5. Scroll down to Privileged Gateway Intents → enable:
    • ✅ Message Content Intent
  6. Go to OAuth2 → URL Generator:
    • Scopes: ✅ bot
    • Bot Permissions: ✅ Send Messages, Read Message History, View Channels
  7. Copy the generated URL → open it in browser → add bot to your server

Step 2 — Create Discord Channels

In your server, create these channels (or use existing ones):

  • #health — main conversation channel
  • #research — weekly research digests land here

Step 3 — Install dependencies

pip install -r requirements.txt
ollama pull llama3   # or your preferred model

Step 4 — Configure

Set your bot token as an environment variable:

export DISCORD_BOT_TOKEN="your_token_here"

# Optional: customise channel names (defaults shown)
export HEALTH_CHANNEL_NAME="health"
export RESEARCH_CHANNEL_NAME="research"

To make the token persist across reboots, add to your ~/.bashrc or ~/.zshrc:

echo 'export DISCORD_BOT_TOKEN="your_token_here"' >> ~/.bashrc

Step 5 — Run

python bot.py

To keep it running permanently:

# Using screen
screen -S health-agent
python bot.py
# Ctrl+A then D to detach

# Or using nohup
nohup python bot.py > logs/bot.log 2>&1 &

Usage

Natural language (just talk to it):

I have a sore throat since yesterday
Should I take zinc with my current stack?
I've been feeling fatigued for 3 days
Research lion's mane for cognitive function
Tell me about berberine

Commands:

!stack                         view your supplement stack
!add Vitamin D 5000IU daily for immune support
!add Magnesium Glycinate 400mg at night for sleep
!remove Vitamin D
!interactions                  full stack interaction check
!checkin 7 8 7.5               log mood/energy/sleep (out of 10)
!checkin 6 5 6 felt foggy, mild headache
!history                       recent symptoms + advice log
!research ashwagandha          deep research on a topic
!summary                       monthly health trend summary

Scheduled (automatic):

  • 8am daily — morning check-in prompt
  • Sunday 9am — weekly research digest posted to #research
  • 1st of month — monthly trend summary

Project Structure

health-agent/
├── bot.py              ← Discord bot + orchestrator
├── requirements.txt
├── agents/
│   ├── router.py       ← classifies incoming messages
│   ├── adviser.py      ← LLM health advice
│   ├── research.py     ← PubMed + longevity feeds
│   └── stack.py        ← supplement management
└── data/
    ├── db.py           ← SQLite layer
    └── health.db       ← created on first run (your data)

Changing the LLM model

In agents/adviser.py, agents/research.py, agents/stack.py:

OLLAMA_MODEL = "llama3"   # change to "phi3:mini", "mistral", etc.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages