heartbit-core-2026.306.7 has been yanked.
heartbit-core
The Rust agentic framework — agents, tools, LLM providers, memory, guardrails, workflow agents, evaluation. Type-safe, async-native, runtime-agnostic.
use Arc;
use ;
async
What's in the box
- ReAct agent loop with parallel tool execution via
tokio::JoinSet. - LLM providers — Anthropic, OpenRouter, Google Gemini, any
OpenAI-compatible endpoint. Composable wrappers:
RetryingProvider(exponential backoff on 429/5xx),CascadingProvider(cheapest model first, escalate on gate rejection), Anthropic prompt caching. - Tools —
Tooltrait,ToolDefinition,ToolOutput. The crate ships a small core set used by the agent loop; the umbrellaheartbitcrate adds the full builtin suite (bash,read/write/edit/patch,web_fetch,web_search, MCP, …). - Memory —
Memorytrait,InMemoryStore,NamespacedMemory. MemGPT-style composite recall (recency + importance + relevance + strength), Ebbinghaus decay, optional vector retrieval. - Guardrails —
Guardrailtrait with four hooks (pre_llm,post_llm,pre_tool,post_tool). Built-ins: LLM-as-judge, secret scanner, PII, content fence, action budget, behavioral monitor, tool policy, injection classifier, sensor security, plus composition (chain, conditional, warn-to-deny). - Workflow agents — deterministic orchestration with no LLM cost:
SequentialAgent,ParallelAgent,LoopAgent,DagAgent,VotingAgent,DebateAgent,MixtureOfAgentsAgent,BatchExecutor. - Orchestrator —
Orchestrator<P>for multi-agent runs with flat hierarchy. Three delegation tools:delegate_task(parallel subtasks),form_squad(collaborative viaBlackboard),spawn_agent(dynamic specialists). - Eval —
EvalRunner,EvalCase, scorers (trajectory, keyword, similarity, cost, latency, tool count, safety),EvalComparisonfor A/B regression testing. - Templates & skills — 15 agent archetypes and 10 domain skills ready to compose into prompts.
- Observability — 29 streaming
AgentEventvariants,OnEventcallback,OnTextfor token streaming,OnApprovalfor human-in-the-loop.
Optional integrations
For Postgres-backed memory, Telegram / Discord / Slack chat adapters,
fastembed local embeddings, sandboxed workspaces, JWT auth, vault,
multi-tenant daemon mode, and Restate-durable execution, add the
heartbit umbrella crate:
The umbrella does pub use heartbit_core::*;, so library code remains
import-compatible regardless of which crate you depend on.
Repository
- Source: github.com/heartbit-ai/heartbit
- API reference: docs.rs/heartbit-core
- Top-level README, examples, full docs: see the repository root.
License
Dual-licensed under MIT or Apache-2.0, at your option.