Skip to main content

What is Mirobody?

Mirobody is an open-source, self-hosted health-data + AI engine — a lightweight C++ core that links your personal health data to LLMs and runs anywhere: standalone on a server, or on-device inside the Android / iOS apps so your data never has to leave the phone.
  • 🧩 One core, three forms — a single C++ engine ships as a standalone binary (HTTP + WebSocket), as a shared library inside the mobile host apps (JNI on Android, a C API on iOS), and via a plain extern "C" surface that any language can embed.
  • 🔌 MCP server — built-in tools are exposed over a Model Context Protocol endpoint, callable by ChatGPT, Claude, Cursor, or any MCP client.
  • 🤖 Multi-provider chat — one streaming interface over OpenAI, Google Gemini, and MiroThinker, plus a fully on-device option (Gemma via LiteRT-LM / llama.cpp) so chat can run with no server and no network.
  • 🔄 Health-data connectors — wearables, phone health stores, and clinical EHRs (via SMART on FHIR) flow in through pluggable vendor clients; on-device stores (Apple Health, Health Connect) are read by the host apps.
  • 🏥 FHIR R4 native — an embedded FHIR R4 endpoint normalizes everything (units to UCUM; indicators mapped toward SNOMED CT / LOINC / RxNorm) and serves it back as FHIR resources.
This docs site covers Mirobody’s health vertical — the engine behind Theta Wellness.

Quick Start

Build the C++ core and run it in minutes

Use Cases & Examples

Real conversations with synthetic health data

Provider Integration

Add a new device or data source in hours

Managed API Platform

Prefer a hosted API over self-hosting? Same engine, managed for you.

Why Mirobody?

The core runs locally end-to-end. On desktop / server it’s a single binary over your own Postgres (or SQLite); on phones the same core runs on-device, so health data never has to leave the device unless you choose to sync it. Bring your own LLM key (OpenAI, Gemini, MiroThinker) — or run fully offline with on-device Gemma.
A single C++ engine with a plain extern "C" C API. It ships as a standalone HTTP / WebSocket binary, as a shared library inside the Android / iOS host apps, and is embeddable from Java, Go, C#, Rust, Swift, or Python via that C ABI — no per-platform rewrite.
One agent: it picks an LLM client by provider name, builds the system prompt, and streams the turn back — calling built-in MCP tools (read files, render charts, family health, memory) as needed.
Tools are C++ files in res/mcp_tools/ that self-register at compile time — drop a .cpp with the MIROBODY_REGISTER_TOOL macro and rebuild. They’re exposed over the /mcp endpoint for ChatGPT / Claude / Cursor and run in-process for the built-in agent.
PDFs (PDFium), Excel / CSV (xlnt), and images (OCR via Tesseract, plus vision-model inlining) are parsed; values are normalized (UCUM) and written to the embedded FHIR store.
Realtime audio chat over WebSocket via OpenAI Realtime and Google Gemini Live.
Create a circle and invite people by email; members can share a conversation (view / edit) or their health data (per-person, off by default). The agent can then answer “how is my family doing?” reading only what members chose to share.

Architecture at a glance

Five pieces make up the core (all C++):
PiecePathNotes
LLM clientssrc/llm/One streaming client per provider — OpenAI, Google Gemini, MiroThinker, on-device Gemma (LiteRT-LM / llama.cpp), plus Realtime / Live audio
MCP toolssrc/mcp/ + res/mcp_tools/Server-side tools over a Model Context Protocol endpoint
Agentsrc/chat/ + res/agents/Picks a client by provider, builds the prompt, streams the turn
Health vendorssrc/health/vendor/Wearables, phone stores, and EHRs (SMART on FHIR) behind one authorize / fetch / webhook contract
FHIR R4src/fhir/Embedded FHIR endpoint + terminology (UCUM; SNOMED CT / LOINC / RxNorm)
Agents and tools self-register at compile time: drop a .cpp in the matching res/ directory and rebuild.

Data sources

Health data flows in through pluggable vendor clients, in four buckets:

Aggregator platforms

Terra, Validic, Human API, Junction, Metriport, … — 15 B2B platforms behind one contract

Device brands

Fitbit, Garmin, Withings (first-party OAuth) — Oura / Polar / Whoop via aggregators

Clinical EHRs

SMART on FHIR — one generic client for ONC-certified EHRs (Epic, Oracle Health / Cerner, athenahealth, …)

On-device stores

Apple Health, Samsung Health, Google Health Connect, Huawei — read on-device, POSTed as FHIR
Add a source by implementing a vendor::Vendor in src/health/vendor/. See Provider Integration.

Tech Stack

  • C++11 core, built with CMake (+ vcpkg on Windows)
  • libwebsockets / libcurl / OpenSSL for HTTP + WebSocket + TLS
  • Storage backends selected at build time: PostgreSQL (desktop default) or SQLite (mobile), also MySQL / DuckDB / ClickHouse; files to S3 / OSS / Azure Blob / local
  • On-device LLM: Gemma via LiteRT-LM (mobile) / llama.cpp (Electron)
  • Embedded FHIR R4 with UCUM / SNOMED CT / LOINC / RxNorm terminology
  • OAuth 2.0 / OIDC authorization server; email-code + Google / Apple / WeChat / GitHub login

Who is this for?

Individual users

Anyone who wants a private, AI-powered home for their health data — without handing it over to a third party

Developers

Engineers building personal-data AI products who want a private, embeddable, on-device-capable health engine instead of building the data + FHIR + MCP plumbing themselves

Real-World Examples

Showcase conversations below use synthetic health data and some Theta-private tools.

Private Health Data Management & Chat

Query the same condition across multiple health systems, even across countries:

Knee Pain Progress

Track knee pain progression across providers

Cardiovascular Disorders

Monitor cardiovascular health across health systems
Combine device data, medical records, and self-reported notes:

Cardiovascular Summary

Summarize cardiovascular conditions across sources

Diabetes History & Progress

Track diabetes from devices, records, and other sources

PCP Visit Preparation

Generate a comprehensive summary and questions for your primary care visit

Deep Research for Personal Health

Figure out what’s actually helping or hurting you:

Blood Glucose Analysis

Find factors that help or harm your blood glucose

Symptoms & Feelings Drivers

Discover the main drivers behind your symptoms and mood

Diabetes Treatment Options

Research personalized options (meds, devices, lifestyle) for diabetes management

Mirobody as a Data Engine for Developers

Wearable manufacturers

Add AI chat over your device data without building the backend

Research applications

Drop custom tools into tools/ to deploy subject-facing research apps

Consumer health apps

Use Mirobody as the data + AI backend behind your product

Enterprise

Contact us for custom integrations and enterprise support

Theta Wellness: Mirobody in Production

Theta Wellness is our flagship application built on Mirobody — a personal health intelligence app that demonstrates what Mirobody can do at production scale. It connects wearables, phone health stores, and EHR records, and supports voice, image, file, and text as inputs. We’re open-sourcing the engine so you can run the same private, on-device-capable health core yourself — self-hosted for the whole family, on your phone offline, or embedded in your own app via the C API.

Next Steps

1

Get started

Follow the Quick Start to build the core (./build.sh) and run it.
2

Configure providers

Set OAuth credentials for the devices you want — see Configuration.
3

Explore the API

Read the API Reference for the OpenAI-compatible /v1 endpoints.
4

Add custom providers or tools

Use Provider Integration for new data sources, or add a C++ tool in res/mcp_tools/.

Contributing

We welcome contributions — new providers, new tools, framework improvements, anything.

GitHub Repository

Source code, issues, and PRs

Contributing Guide

How to submit changes

Community & Support

Discord

Community discussions (coming soon)

GitHub Issues

Bug reports and feature requests

Mirobody Support

Direct technical support
This docs site covers Mirobody’s health vertical. For the open-source engine repo, see github.com/thetahealth/mirobody.