1. Automated CLI Quickstart (`npx moven-ai-cli`)
Zero-config agent discovery, setup, and key pairing.
Run npx moven-ai-cli init in your project repository root. Moven automatically inspects `package.json` dependencies, parses your source files for model declarations, prompts for your **Production Agent Name** and **Moven Project Name**, and pairs authentication via browser magic link.
npx moven-ai-cli init
- Detects installed agent frameworks (`LangGraph`, `LlamaIndex`, `Vercel AI SDK`, `CrewAI`, `AutoGen`).
- Scans local code files for model strings (`gpt-4o`, `claude-3-5-sonnet`, `gemini-1.5-pro`).
- Launches browser magic URL (`https://moven.dev/auth/cli-login?token=...`).
- Generates type-safe
moven.config.tsconfiguration file. - Appends authenticated
MOVEN_API_KEYinto local `.env`.
2. Deep Fuse Engine Architecture Specification
Sub-millisecond in-memory tool wrapping, thread safety & distributed event pipeline.
The Moven Fuse Engine operates as an in-process interceptor around native AI agent tool execution functions. Designed for high-concurrency enterprise workloads (100,000+ operations/sec), it guarantees zero blocking latency (<0.8ms evaluation overhead) by conducting deterministic state evaluations in-memory prior to passing control to the underlying tool runtime.
Instantiates a lightweight MovenRunState instance storing ring-buffered tool call logs. Automatically cleans up expired state objects after 1 hour to prevent memory bloat.
Utilizes O(1) hash map indexing for rapid sliding-window repeat call calculations across concurrent asynchronous tool execution threads.
Telemetry events (spans, kill alerts, money saved metrics) are dispatched non-blockingly in background batches to /api/events with automatic retry backoff.
3. Mathematical Trip Heuristics & Formulas
Exact mathematical equations evaluating tool executions in real-time.
Given tool calls T = {t_1, t_2, ..., t_n}, evaluate timestamp window Ξt = t_now - t_i <= 60000ms:
If Count >= maxRepeatCalls (default 5) -> TRIP FUSE
Calculates cumulative dollar expenditure and evaluates progress uniqueness across state hashes:
EffectiveCap = IsProgress ? (maxCostDollar * 1.25) : maxCostDollar
If cumulativeCost >= EffectiveCap -> TRIP FUSE
Estimates prevented token cost burn when a runaway agent is intercepted early:
PreventedTokens = PreventedSteps * 4,000 tokens
MoneySaved = max(((PreventedTokens / 1,000,000) * $2.50) - actualRunCost, $0.50)
4. Adaptive Recovery Lifecycle Specifications
Dynamic model downgrading and automatic primary model restoration.
Upon detecting a soft hallucination warning or repeat pattern, Moven routes subsequent LLM calls to a cheaper fallback model (e.g. `openai/gpt-4o-mini` or `google/gemini-2.5-flash-lite`). The run state monitors execution: once the agent completes 3 consecutive clean turns, Moven automatically restores execution to the primary model.
5. Multi-Agent DAG Context Propagation
Tracking recursive parent-child sub-agent trees across AsyncLocalStorage.
In multi-agent architectures (`LangGraph` state graphs, `CrewAI` manager/worker teams, `AutoGen` chat groups), sub-agents spawn nested sub-threads. Moven uses Node.js AsyncLocalStorage to propagate parent `traceId` and execution depth levels implicitly across sub-agent calls.
6. 20+ Enterprise AI Provider Proxy Specs
Universal Time-Travel Replay endpoint at `/api/replay` supporting all major models.
8. Webhook Ingestion & Slack Alerts
Instant HTTP POST alert dispatches when a fuse trips.
When a fuse trips, /api/events dispatches real HTTP POST payloads to configured Slack channels and custom HTTP webhooks containing offending tool parameters, exact reasons, and money saved estimates.
9. moven.config.ts Parameter Reference
Exhaustive specification for all MovenCircuitBreaker options.
| Parameter | Type | Default | Description & Trip Mechanics |
|---|---|---|---|
| agentId | string | "agent_run" | Unique deterministic slug for tracing multi-agent execution sub-trees. |
| agentName | string | "default-agent" | Human-readable agent identifier shown in terminal banners & cloud telemetry. |
| maxRepeatCalls | number | 5 | Trips when tool calls with identical SHA-256 argument hashes occur N times within repeatTimeWindowMs. |
| repeatTimeWindowMs | number | 60000 (60s) | Sliding time window duration in milliseconds for repeat tool call evaluation. |
| maxCostDollar | number | $2.00 | Dollar spending ceiling. Grants 25% cost headroom buffer if active non-repetitive state progress is detected. |
| maxDepth | number | 15 | Maximum allowed recursion depth for sub-agent call chains before tripping depth_ceiling. |
| maxNoProgressTurns | number | 3 | Trips when N consecutive tool execution turns produce 100% identical output state hashes. |
| cheaperModel | string | "openai/gpt-4o-mini" | Target model ID dynamically resolved per model author/provider during hallucination alerts. |
| onHallucination | function | undefined | Callback receiving { agentName, reason, toolName, args } when fuse intercepts a run. |
import { createMovenCircuitBreaker } from 'moven-sdk';
export const movenCircuitBreaker = createMovenCircuitBreaker({
agentId: 'agent_inventory_production_agent',
agentName: 'inventory_production_agent',
framework: 'LangGraph / LangChain',
maxRepeatCalls: 3,
repeatTimeWindowMs: 60000,
maxCostDollar: 2.00,
maxDepth: 15,
maxNoProgressTurns: 3,
provider: 'openrouter',
currentModel: 'openai/gpt-4o-mini',
cheaperModel: 'openai/gpt-5.6-luna-pro',
autoFallbackCheaperModel: true,
enableLlmJudgeArbitrator: true,
onHallucination: ({ agentName, reason, toolName }) => {
console.warn(`[Moven Alert] Agent '${agentName}' hallucinated on tool '${toolName}': ${reason}`);
},
apiKey: process.env.MOVEN_API_KEY,
});10. Production Troubleshooting & FAQs
Common enterprise integration scenarios and resolutions.
Moven operates in standalone mode. All local circuit breaker rules continue evaluating in-memory and throwing `MovenKillError` cleanly without crashing the agent execution thread.
Moven serializes all tool input arguments using deterministic canonical stringifiers (`JSON.stringify` with sorted keys) to guarantee exact hash equality regardless of object key order.
