Introductionv1.0.4-beta

Last updated: 02/07/2026

How it Works

The agent loop from context to execution.

Habi orchestrates agents through a predictable loop: observe market context, evaluate habits and risk rules, propose a plan, and execute only when policy allows.

The agent loop

  1. Context — ingest prices, funding, sentiment, and portfolio state.
  2. Reason — agent drafts a trade plan with explicit rationale.
  3. Guard — risk engine and habits approve, flag, or reject.
  4. Execute — orders route through connected venues and vaults.
typescript
// Example: habit check before execution
const decision = await riskEngine.evaluate({
  agentId: "momentum-btc",
  proposedNotional: 12_500,
  maxDrawdownPct: 8,
});

if (decision.status === "allow") {
  await executor.submit(decision.plan);
}