Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:

Docker

Docker Compose

You can verify your Docker installation by running docker --version and docker-compose --version

Installation Steps

1

Clone the repository

Clone the Mirobody Health repository to your local machine:
git clone https://github.com/thetahealth/mirobody-health.git
cd mirobody-health
2

Set up configuration files

Create your .env file and the config file:
cp .env.example .env
cp config.yaml config.localdb.yaml
The ENV variable tells the system which config file to use. ENV=localdb loads config.localdb.yaml.
3

Set environment variable

Edit .env to set your configuration file:
.env
ENV=localdb
This tells the system to use config.localdb.yaml for configuration.
4

Add API keys and configure agents

Create config.localdb.yaml and add at least one LLM API key:
config.localdb.yaml
# ============ LLM API Keys (At least one required) ============
GOOGLE_API_KEY: ''      # For Gemini models
OPENAI_API_KEY: ''      # For GPT models  
OPENROUTER_API_KEY: ''  # For Claude, DeepSeek, and other models via OpenRouter

# ============ Agent Configuration ============
# Tool directories for MCP tools
MCP_TOOL_DIRS:
  - mirobody/pub/tools
  - mirobody/pub/tools_health

# Resource directories for MCP resources  
MCP_RESOURCE_DIRS:
  - mirobody/pub/resources

# Agent directories
AGENT_DIRS:
  - mirobody/pub/agents
At least one API key is required for the system to work:
Mirobody Health includes two agent types:
  • DeepAgent (LangChain-based): Best for complex tasks, file operations, multi-step planning
  • BaselineAgent (Native Gemini): Best for simple conversations, lightweight MCP integration
See Tools Overview for details on agent capabilities and configuration.
5

Configure providers (Optional)

If you want to connect wearable devices like Garmin or Whoop, add their OAuth credentials:
config.localdb.yaml
# Provider OAuth Credentials (Optional)
GARMIN_CLIENT_ID: ''
GARMIN_CLIENT_SECRET: ''
GARMIN_REDIRECT_URI: ''

WHOOP_CLIENT_ID: ''
WHOOP_CLIENT_SECRET: ''
WHOOP_REDIRECT_URI: ''
See the Configuration guide for complete provider setup.
6

Deploy with Docker

Run the deployment script to start all services:
./run.sh
This will start three services:
  • Backend API on port 18080
  • PostgreSQL database on port 5432
  • Redis cache on port 6379
Wait for all services to start. You should see logs indicating successful startup.
7

Verify the installation

Open your browser and navigate to:
http://localhost:18080
You should see the Mirobody Health welcome page.
8

Log in

Log in with the default demo account or the accounts set up in config.yaml.
Once logged in, you can:
  • Upload files: Lab reports, medical records, health documents (see File Processing)
  • Chat with AI: Ask questions about your health data
  • Connect providers: Link Garmin, Whoop, and other devices (see Using Providers)

Test the API

Once the services are running, you can test the API endpoints:
Verify the server is running:
curl http://localhost:18080/health

Available Endpoints

After deployment, the following endpoints are available:

Docker Services

The deployment includes three containerized services:
ServicePortDescription
backend18080FastAPI application server
postgres5432PostgreSQL database
redis6379Redis cache and session store
You can view logs for any service using:
docker-compose logs -f backend
docker-compose logs -f postgres
docker-compose logs -f redis

Common Commands

docker-compose down
docker-compose restart
# All services
docker-compose logs -f

# Specific service
docker-compose logs -f backend
docker-compose down
docker-compose build --no-cache
docker-compose up -d
docker-compose exec postgres psql -U holistic_user -d holistic_db
docker-compose exec redis redis-cli

Troubleshooting

If port 18080 is already in use, edit config.yaml:
HTTP_PORT: 18081  # Change to an available port
Then restart the services.
Ensure PostgreSQL container is running:
docker-compose ps postgres
Check database logs:
docker-compose logs postgres
Verify Redis is running and accessible:
docker-compose exec redis redis-cli ping
Should return PONG if working correctly.
Make the script executable:
chmod +x deploy.sh

Next Steps

Now that you have Mirobody Health running:
For production deployment, see the Production Deployment guide for security hardening and performance optimization.