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.
Feature Reference
Section titled “Feature Reference”| Feature | Dependencies | What it enables |
|---|---|---|
core (default) | — | Agent runner, orchestrator, LLM providers, tools, memory, config |
kafka | rdkafka | Kafka consumer/producer |
daemon | kafka + cron, prometheus | Daemon with HTTP API, cron scheduling, metrics |
sensor | daemon + quick-xml, hmac | 7 sensor sources (RSS, Email/JMAP, Webhook, Weather, Audio, Image, MCP), triage, story correlation |
restate | restate-sdk 0.8 | Durable workflow execution via Restate |
postgres | sqlx, pgvector | PostgreSQL memory store and task store |
a2a | a2a-sdk | Agent-to-Agent protocol support |
telegram | teloxide | Telegram bot integration for daemon mode |
local-embedding | fastembed | Local ONNX embeddings via fastembed (no API keys required) |
full | all above (except local-embedding) | Everything |
Dependency Graph
Section titled “Dependency Graph”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)
full = kafka + daemon + sensor + restate + postgres + a2a + telegramNote that local-embedding is excluded from full because fastembed pulls in ONNX Runtime which significantly increases binary size. Enable it explicitly when needed.
As a library
Section titled “As a library”# Core only (default)cargo add heartbit
# With specific featurescargo add heartbit --features postgres,local-embedding
# Everythingcargo add heartbit --features fullIn Cargo.toml
Section titled “In Cargo.toml”[dependencies]heartbit = { version = "*", features = ["daemon", "postgres"] }Building from source
Section titled “Building from source”# Default (core only)cargo build -p heartbit-cli
# With daemon and Telegramcargo build -p heartbit-cli --features daemon,telegram
# Full buildcargo build -p heartbit-cli --features fullBuild Prerequisites
Section titled “Build Prerequisites”Some features require system libraries:
| Feature | System dependencies |
|---|---|
kafka / daemon / sensor | cmake, libssl-dev, pkg-config (for rdkafka) |
local-embedding | ONNX Runtime (bundled by fastembed) |
postgres | PostgreSQL client libraries |