Multi-model AI agent ecosystem with 5-layer escalation hierarchy, exponential backoff retries, and automatic fallback chaining across Claude, GLM, and DeepSeek
Multi-model AI agent system with a 5-layer escalation hierarchy, automatic retry with exponential backoff, and cascading fallback chaining across DeepSeek, GLM, and DeepSeek.
| Layer | Model | Role | Use Cases |
|---|---|---|---|
| L5 | Claude Opus | Editor | Life advice, strategic decisions, final blog polish |
| L4 | Claude Sonnet | Writer | Blog drafts, complex documents, email replies |
| L3 | GLM-4 | Secretary | Google Calendar, Gmail, schedule management |
| L2 | DeepSeek V3 | Gatekeeper | Daily chat, classification, log summarization |
| L1 | Claude Code | Engineer | File ops, system config, debugging |
The ModelRouter analyzes message complexity and emotional context to automatically select the appropriate layer. Routing decisions are logged to logs/model-router.log.
Every API call is wrapped with withRetry() (exponential backoff: 0 → 1 → 2 → 4 seconds, up to 3 retries). If all retries are exhausted, the handler automatically falls back to the next layer down:
Claude Opus → Claude Sonnet → GLM → DeepSeek → throw
Fallbacks are logged with fallback_triggered: true and the error reason. DeepSeek is the final tier and will throw if it also fails.
Retryable errors: Anthropic 429/529, Axios 429/503, ECONNRESET, ETIMEDOUT, ECONNREFUSED.
src/
├── core/
│ └── model-router.js # Complexity analysis, model selection, escalation
├── models/
│ ├── deepseek-opus.js # L5: high-complexity tasks
│ ├── deepseek-sonnet.js # L4: writing tasks
│ ├── glm-handler.js # L3: business/secretary tasks
│ ├── deepseek-handler.js # L2: lightweight tasks
│ └── claude-code.js # L1: engineering tasks
├── utils/
│ └── api-retry.js # withRetry(), isRetryableError(), FALLBACK_CHAIN
├── emotion/
│ └── emotional-context-engine.js
└── integrations/
Open-source AI coding agent for the terminal. Claude Code-grade accuracy with smart model routing — uses the right AI model for each task, cutting costs 10x. Supports Claude, GPT, Gemini, DeepSeek & more.
A general-purpose Python framework for building LLM agents and multi-agent systems. "Four lines of code, an agent with memory."
Ultimate LLM API Integration Cookbook 2026 for Cursor & AI Agents
Ultimate Multi-Agent OS for Autonomous AI NPCs 2026
PrivateAgent is an open-source Android automation agent built with Flutter. It utilizes the DeepSeek API and native Android Accessibility Services to interpret screen layouts and execute multi-step tasks across any installed application via natural language commands.
把一队分工 Agent 织成一条写小说的流水线,做成桌面客户端;写作指纹让它越写越像你(BYO DeepSeek key,纯本地)。
Workflows from the Neura Market marketplace related to this DeepSeek resource