ReAct Orchestration
Kernel Service uses the ReAct (Reason + Act) pattern for task execution. The agent alternates between reasoning about what to do and taking actions via tools.
The Loop
1. Build context (agent + objective + tools)2. Call LLM with available tools3. If LLM returns tool calls: → Execute tools → Add results to context → Go to step 24. If LLM returns final answer: → Record output → Complete taskSafety Guardrails
- Max iterations: Hard limit (default 10) prevents infinite loops
- Tool permissions: Agents can only use tools they’re explicitly allowed
- Execution modes: Outbound actions (email, messages) are draft-only by default
- Budget enforcement: Token/cost limits per tenant (coming soon)
Multi-Provider Fallback
If the primary LLM fails, the orchestrator automatically falls back:
| Tier | Primary | Fallback 1 | Fallback 2 |
|---|---|---|---|
| Cheap | Gemini Flash | Claude Haiku | GPT-4o-mini |
| Expensive | Claude Sonnet | Gemini Pro | GPT-4o |