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
- Context — ingest prices, funding, sentiment, and portfolio state.
- Reason — agent drafts a trade plan with explicit rationale.
- Guard — risk engine and habits approve, flag, or reject.
- 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);
}