CnOps 智能运维与可观测社区
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题
导航菜单
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题

CnOps 智能运维与可观测社区

愿景

CnOps 智能运维与可观测社区是一个以"智能运维与可观测"为核心的开放、包容、分享的技术社区,旨在聚集运维专家、开发者和爱好者,共同探讨、学习和分享可观测最佳实践与最新技术,与众多技术社区合作互动,共同探讨交叉领域的技术挑战,推动可观测领域的创新与进步。

内容社区

  • 实践文章
  • 视频课程
  • 开源项目
  • 常见问答
  • 开发者工具

友情链接

  • Prometheus
  • Grafana Lab
  • OpenTelemetry
  • LoongCollector

关注我们

阿里云云原生公众号阿里云云原生
阿里云可观测公众号阿里云可观测

Copyright © 2026 CnOps 社区. All rights reserved.

首页/开源项目/UModel/架构总览
文档目录
UModel 中文文档
架构总览运行时流程Query 与 Agent 架构扩展点
GraphStore Providers文档国际化规则Web UI 架构Web UI API 对照UModel SDK 规范

UModel

架构总览

UModel 是 local-first 服务:REST API、CLI、Web UI、SDK 和 MCP 共享同一组领域服务和公共契约。 | 层 | 路径 | 职责 | |---|---|---| | Entry | cmd/umodel-server, cmd/umctl, cmd/umodel-mcp | 进程、flags、本地运行入口。 | | API adapters |...

UModel 是 local-first 服务:REST API、CLI、Web UI、SDK 和 MCP 共享同一组领域服务和公共契约。

系统视图

flowchart LR
  Developer["Developer / SRE"]
  Agent["MCP client / Agent"]
  Web["Web UI"]
  CLI["umctl"]
  SDK["SDK clients"]
  MCP["umodel-mcp"]
  REST["REST API"]
  Workspace["Workspace Service"]
  UModel["UModel Service"]
  EntityStore["EntityStore"]
  Query["Query Service"]
  AgentGateway["AgentGateway"]
  GraphStore["GraphStore"]
  Provider["memory / file.memory / local.ladybug"]

  Developer --> Web
  Developer --> CLI
  Developer --> SDK
  Agent --> MCP
  Web --> REST
  CLI --> REST
  SDK --> REST
  MCP --> AgentGateway
  REST --> Workspace
  REST --> UModel
  REST --> EntityStore
  REST --> Query
  REST --> AgentGateway
  UModel --> GraphStore
  EntityStore --> GraphStore
  Query --> GraphStore
  AgentGateway --> Query
  GraphStore --> Provider

分层

层 路径 职责
Entry cmd/umodel-server, cmd/umctl, cmd/umodel-mcp 进程、flags、本地运行入口。
API adapters api/openapi, api/mcp, internal/bootstrap REST routing、MCP schema、server wiring。
Application services internal/workspace, internal/umodel, internal/entitystore, internal/query, internal/agentgateway Workspace、模型写入、运行时写入、读取和 Agent 接入。
Contracts pkg/contract, pkg/model, pkg/errors 公共接口、共享类型、稳定错误 envelope。
Storage abstraction internal/graphstore Provider-neutral 的持久化和图访问。
Providers memory, file.memory, local.ladybug 运行时存储实现。
Clients web, sdk/go, sdk/python, generated/java 用户和集成客户端。

公共契约

公共契约包括:

  • REST OpenAPI:api/openapi/openapi.yaml
  • MCP schema:api/mcp/tools.schema.json
  • 共享模型类型:pkg/model/types.go
  • 服务契约:pkg/contract/contracts.go
  • CLI 行为:CLI 参考

公共契约变更必须在同一个 PR 中更新 docs、tests、examples、SDK 期望和 Web UI。

核心设计决策

  • 所有操作都以 workspace 为边界。
  • Query Service 是模型、实体和拓扑数据的唯一公共读取路径。
  • EntityStore 负责写入运行时对象和关系,不提供公共读取 API。
  • UModel Service 负责模型定义写入和校验。
  • AgentGateway 通过 Query Service 获取运行时 rows,resources 保持 metadata-oriented。
  • GraphStore provider 隔离持久化细节。

Architecture Guard

Architecture guard:tools/guards/architecture_guard.py。运行方式:

make guard

Guard 保护关键边界,例如不在 Query Service 外新增公共领域读取 API,业务模块不直接导入 provider 实现包。

文章大纲