2.0 KiB
2.0 KiB
Agent System Architecture
The Dexorder AI platform uses a sophisticated agent harness that orchestrates between user interactions, LLM models, and user-specific tools.
Core Components
Gateway
Multi-channel gateway supporting:
- WebSocket connections for web/mobile
- Telegram integration
- Real-time event streaming
Agent Harness
Stateless orchestrator that:
- Fetches context from user's MCP server
- Routes to appropriate LLM model based on license
- Calls LLM with embedded context
- Routes tool calls to user's MCP or platform tools
- Saves conversation history back to MCP
Memory Architecture
Three-tier storage system:
- Redis: Hot state for active sessions and checkpoints
- Qdrant: Vector search for RAG and semantic memory
- Iceberg: Cold storage for durable conversations and analytics
User Context
Every interaction includes:
- User ID and license information
- Active channel (websocket, telegram, etc.)
- Channel capabilities (markdown, images, buttons)
- Conversation history
- Relevant memories from RAG
- Workspace state
Skills vs Subagents
Skills
Self-contained capabilities for specific tasks:
- Market analysis
- Strategy validation
- Indicator development
- Defined in markdown + TypeScript
- Use when task is well-defined and scoped
Subagents
Specialized agents with dedicated memory:
- Code reviewer with review guidelines
- Risk analyzer with risk models
- Multi-file knowledge base
- Custom system prompts
- Use when domain expertise is needed
Global vs User Memory
Global Memory (user_id="0")
Platform-wide knowledge available to all users:
- Trading concepts and terminology
- Platform capabilities
- Indicator documentation
- Strategy patterns
- Best practices
User Memory
Personal context specific to each user:
- Conversation history
- Preferences and trading style
- Custom indicators and strategies
- Workspace state
All RAG queries automatically search both global and user-specific memories.