An ambient agent that wakes on every tick is expensive and usually wrong. An agent that wakes only when something meaningful happens is efficient and decisive. The alert and interest-watch system is how you configure exactly when your agent is called to act.

Two types of wakeup conditions

Price / pattern alerts (arm_alert)

An alert fires when a market condition crosses a threshold. The agent arms these at day start and after each deployment decision. Examples of conditions an agent might arm:

  • NIFTY50 drops more than 1.5% from the day's open
  • RELIANCE RELIANCE logoNSE:RELIANCE LTP crosses above its 20-day EMA
  • BANKNIFTY IV percentile spikes above 80
  • A deployed strategy's drawdown exceeds 2%

When the alert fires, the agent wakes with a payload that includes the instrument, the current price, and the on_fire_message the agent set when arming. The agent then decides whether to act.

Interest watches (arm_interest_watch)

An interest watch is a softer condition: tell me when this instrument starts moving interestingly. Where an alert is a threshold crossing, a watch is a pattern detection trigger (momentum building, OI accumulation, spread narrowing).

The agent typically arms interest watches for instruments it has researched but not yet deployed, so it can re-evaluate if the market starts confirming the thesis.

What happens on a wake

When an alert fires, the wake message delivered to the agent contains:

Wake reason: alert:fired:<alert_id> Alert name: RELIANCE_EMA_CROSS On-fire message: RELIANCE crossed above 20-EMA. Check momentum and OI accumulation. Context: RELIANCE | LTP: 2,847.50 | Change: +1.2% | Time: 10:34 IST

The agent reads this, pulls fresh quotes and OI data if needed, checks its beliefs about the instrument, checks the opportunity board, and decides:

  • Deploy: the condition confirms the thesis, so it researches and deploys a paper strategy.
  • Watch: promising but not enough signal, so it re-arms the alert with a tighter condition.
  • Stand down: condition is no longer valid (e.g. regime changed), so it cancels the alert and records the decision in the missed-alpha ledger.

A stand-down is a legitimate outcome. Forcing a trade on every wake is how algorithms blow up.

Cooldown tuning

Every alert has a cooldown period, which is the minimum time before it can fire again. This prevents a single volatile instrument from waking the agent every 30 seconds.

SituationRecommended cooldown
Intraday price/momentum alerts5-10 minutes
Daily regime-level alerts30-60 minutes
Deployment drawdown monitoring5 minutes
EOD position managementOnce per day

The default is 5 minutes. Tighten only when you genuinely want sub-5-minute reactions, usually only for stop-loss monitoring on live positions.

Regime-transition wakes

Beyond alerts you arm explicitly, the ambient worker also wakes the agent on market regime transitions when NIFTY's trend direction or volatility regime changes materially. These wakes are delivered as:

Wake reason: regime:sideways->uptrend

The agent treats this as a discovery nudge, not an automatic trade signal. It re-evaluates its existing beliefs, checks whether open deployments are still regime-aligned, and may arm new interest watches for instruments it expects to benefit from the new regime.

Deployment event wakes

When a deployed paper strategy trades (a signal fires and an order is placed), the agent wakes automatically:

Wake reason: event:deployment.trade_fired

This lets the agent review the trade, confirm the fill, check if the position should be monitored more tightly, and arm a stop-loss alert if it hasn't already. This is the monitoring loop that keeps the agent in touch with its open positions.

Cancelling alerts

Alerts are automatically cancelled when:

  • The alert fires and the agent explicitly cancels it after acting
  • The associated deployment is stopped
  • The agent decides the thesis is no longer valid

The agent can also cancel alerts proactively. For example, if a better opportunity is found in a different instrument, it may cancel watches on lower-priority instruments to reduce noise.

The day-start survey

Every morning the agent gets a day_start wake before market open. During this wake it:

  1. Reviews yesterday's findings and open deployments
  2. Pulls the current regime snapshot (trend, volatility, sector rotation)
  3. Decides which of yesterday's alerts to re-arm and which to drop
  4. Arms any new interest watches based on the updated regime

This is the most important wake of the day. It sets the agenda for everything that follows. An agent that does a thorough day-start survey and arms precise conditions will outperform one that arms broad, noisy conditions.

Seeing your active alerts

From the Ambient tab, click into any agent to see its current alert list:

  • Alert name and condition
  • Instrument it's watching
  • Cooldown remaining
  • Last fired time (if applicable)
  • The on-fire message the agent will receive

You can see the full alert history in the wake log: every alert that fired, the agent's reasoning, and the decision it made.

Next steps