架构概述
Wisdoverse Nexus 是一个模块化的 AI 原生协作平台,采用 Rust 异步架构。
核心设计原则
- 可扩展性能 — 基于 Tokio 异步运行时,并通过 benchmark 验证容量边界
- 模块化 — 每个功能独立 crate,可单独使用
- 可扩展 — 插件系统支持 Wasm 沙箱隔离
- 云原生友好 — 通过容器、Helm 和可观测性配置支持部署演进
系统架构
┌─────────────────────────────────────────────────────────────┐
│ 客户端层 │
│ Web Client │ Mobile App │ CLI │ Third-party │
└──────────────────────┬─────────────────────────────────┘
│ WebSocket / HTTP
┌──────────────────────▼─────────────────────────────────┐
│ nexis-gateway │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Auth │ │ Router │ │ Rate │ │ Metrics │ │
│ │ Middleware│ │ │ │ Limiter │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────┬─────────────────────────────────┘
│
┌──────────────────────▼─────────────────────────────────┐
│ 核心层 │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ nexis- │ │ nexis- │ │ nexis- │ │ nexis- │ │
│ │ protocol │ │ context │ │ memory │ │ task │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────┬─────────────────────────────────┘
│
┌──────────────────────▼─────────────────────────────────┐
│ 扩展层 │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ nexis- │ │ nexis- │ │ nexis- │ │ nexis- │ │
│ │ plugin │ │ mcp │ │ ai │ │ skills │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘核心 Crates
| Crate | 职责 |
|---|---|
nexis-gateway | WebSocket 网关、HTTP API |
nexis-protocol | 消息协议定义 |
nexis-context | 会话上下文管理 |
nexis-plugin | Wasm 插件系统 |
nexis-memory | 长期记忆存储 |
nexis-ai | AI 提供商抽象和协作能力 |
技术栈
- 运行时: Tokio 1.x
- HTTP/WebSocket: Axum + axum-extra
- 序列化: Serde
- 认证: JWT (jsonwebtoken)
- 追踪: OpenTelemetry + Tracing
- 测试: 内置 test framework + tokio-test