Skip to content

Feature Flags

Heartbit uses Cargo feature flags to control which capabilities are compiled in. This keeps the binary small when you only need core functionality and allows opting in to heavier dependencies.

FeatureDependenciesWhat it enables
core (default)Agent runner, orchestrator, LLM providers, tools, memory, config
kafkardkafkaKafka consumer/producer
daemonkafka + cron, prometheus, jsonwebtoken, base64Daemon with HTTP API, cron scheduling, metrics, JWT auth
sensordaemon + quick-xml, hmac, sha2, hex, subtle7 sensor sources (RSS, Email/JMAP, Webhook, Weather, Audio, Image, MCP), triage, story correlation
restaterestate-sdk 0.8Durable workflow execution via Restate
postgressqlx, pgvectorPostgreSQL memory store and task store
a2aa2a-sdkAgent-to-Agent protocol support
telegramteloxideTelegram bot integration for daemon mode
local-embeddingfastembedLocal ONNX embeddings via fastembed (no API keys required)
macroheartbit-macroProc-macro attribute for tool definitions
fullall above (except local-embedding, macro)Everything
core (default)
|
+-- kafka (rdkafka)
| |
| +-- daemon (+ cron, prometheus)
| |
| +-- sensor (+ quick-xml, hmac)
|
+-- restate (restate-sdk)
+-- postgres (sqlx, pgvector)
+-- a2a (a2a-sdk)
+-- telegram (teloxide)
+-- local-embedding (fastembed)
+-- macro (heartbit-macro)
full = daemon + sensor + restate + postgres + a2a + telegram

Note that local-embedding and macro are excluded from full. local-embedding pulls in ONNX Runtime which significantly increases binary size, and macro is a separate proc-macro crate. Enable them explicitly when needed.

Terminal window
# Core only (default)
cargo add heartbit
# With specific features
cargo add heartbit --features postgres,local-embedding
# Everything
cargo add heartbit --features full
[dependencies]
heartbit = { version = "*", features = ["daemon", "postgres"] }
Terminal window
# Default (core only)
cargo build -p heartbit-cli
# With daemon and Telegram
cargo build -p heartbit-cli --features daemon,telegram
# Full build
cargo build -p heartbit-cli --features full

Some features require system libraries:

FeatureSystem dependencies
kafka / daemon / sensorcmake, libssl-dev, pkg-config (for rdkafka)
local-embeddingONNX Runtime (bundled by fastembed)
postgresPostgreSQL client libraries