System Architecture Overview
Architecture Overview
EchoCenter adopts a layered architecture design, mainly consisting of the following components:
Core Components
Backend Service (Go + Gin)
- HTTP API service
- WebSocket communication
- Business logic processing
Frontend Application (React + TypeScript)
- User interface
- Real-time message display
- State management
Butler Service (Go)
- Core agent
- Message processing
- Command execution
Agent Simulators (Python)
- Storage-Custodian
- Other simulated agents
Database
- User data
- Chat history
- System configuration
Architecture Diagram
:::demo
mermaid
graph TD
A[User] --> B[Frontend Application]
B --> C[Backend Service]
C --> D[Database]
C --> E[Butler Service]
E --> F[Agents]:::
Data Flow
User Request Flow
User
↓
HTTP Request → Backend API → Handler → Business Logic → Database
↑
Response ←───────────────────────────────────────┘Real-time Communication Flow
User/Agent
↓
WebSocket Connection
↓
Hub (Message Distribution)
↓
Message Handler
↓
Butler Service
↓
AI Brain (Eino)
↓
AgentsTech Stack
Backend
- Go 1.22+ - Programming Language
- Gin - HTTP Framework
- Gorilla WebSocket - WebSocket implementation
- Configurable Database Layer - Database
- Eino - AI Inference Engine
Frontend
- React 19 - UI Framework
- TypeScript - Type Safety
- Tailwind CSS - Styling Framework
- Vite - Build Tool
Agents
- Python 3.9+ - Programming Language
- OpenAI SDK - AI Interface
- WebSockets - Communication library
Component Responsibilities
Backend Service
- Provide REST API
- Manage WebSocket connections
- Handle user authentication
- Coordinate agent communication
- Data persistence
Frontend Application
- User interface
- Real-time message display
- State management
- Agent monitoring
Butler Service
- Core agent coordination
- Message processing
- Command execution
- Authorization requests
Agent Simulator
- Simulate real agents
- Provide test data
- Verify system functionality
Extensibility
Adding New Agents
- Create a new Python agent script
- Implement WebSocket communication
- Register in the database
- Start the agent
Adding New API Endpoints
- Add a handler in
handler - Add a route in
router - Add middleware (if needed)
- Test the endpoint
Performance Considerations
- Concurrency - Use goroutines to handle concurrent requests
- Connection Pool - WebSocket connection pool management
- Database Optimization - Connection pool and index optimization
- Caching - Redis caching can be added in the future
Security
- JWT Authentication - Token authentication
- Password Hashing - Bcrypt hashing
- CORS Configuration - Cross-origin protection
- Input Validation - Request validation