Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I open-sourced the part of a proactive AI assistant that decides when not to speak

Описание и применение

Открытый исходный код модуля подавления сообщений в проактивном AI‑ассистенте, реализующий 12 проверок, атомарный контроль бюджета и возможность симуляции политики.

Задача

Proactive AI assistants often lack a robust mechanism to decide when not to speak, leading to unwanted or poorly timed messages.

Результат

The open-source gate provides a single, ordered set of suppression checks, logs detailed reasons for rejections, enforces daily budgets atomically, and allows policy replay and simulation, enabling reliable proactive messaging.

Рабочий процесс

  • Install the gate: npm install proactive-gate
  • Create a gate with a Redis store and default checks: createGate({store:new RedisStore(redis), checks:defaultChecks({dailyLimit:3, quietHoursFloor:'high'}), onDecision:d=>log.info('gate',d)})
  • Evaluate a candidate: const decision=await gate.evaluate({user,candidate})
  • If allowed and commit succeeds, send the message: if(decision.allowed && await gate.commit(decision,{user,candidate})) await send(decision.surfaces,candidate.payload)
  • Use npx proactive-gate simulate to replay traffic and analyze policy impact before shipping.
  • Define policies as JSON files and replay with npx proactive-gate replay --policy policy.json to test new rules.
  • Handle store errors by configuring onStoreError to either allow or reject on failure.

Доказательства

Zero dependencies, TypeScript, Node 20 or newer.

Источник

The budget is enforced at send time, not at evaluate time

Источник

When Redis is down, the default lets the candidate through and writes outcome: "skip"

Источник

  • Дата записи: 2026-09-18T05:30:32.507Z