Skip to content

快速开始

English: Quick Start

启动已加载内置多域 demo 的 UModel,然后查询模型、实体、拓扑和 AgentGateway 元数据。

1. 启动并加载 Demo 数据

bash
make quickstart

API 地址是 http://localhost:8080,Web UI 地址是 http://localhost:5173

Quickstart 使用 GRAPHSTORE=memory 预加载 demo workspace。进程停止后 demo 状态重置。

选择路径:

  • Web UI:打开 http://localhost:5173,选择 demo,通过 Explorer、Query、Data Store 和 Agent 视图查看样例。文档:Web UI 指南
  • Agent 集成:用 umctl agent discover demo 查看 AgentGateway 能力,再通过 umodel-mcp 连接 MCP client。文档:MCP 参考Query 与 Agent 架构
  • CLI 或 REST 查询:通过 Query Service 运行 .umodel.entity.topo。文档:Query Service 指南

样例资产:examples/quickstart-multidomain

仅启动 API:

bash
go run ./cmd/umodel-server --quickstart

2. 查询模型定义

bash
go run ./cmd/umctl --addr http://localhost:8080 query run demo ".umodel with(kind='entity_set') | sort name | limit 10"

3. 查询运行时实体

bash
go run ./cmd/umctl --addr http://localhost:8080 query run demo ".entity with(domain='devops', name='devops.service', query='checkout') | limit 10"

4. 查询拓扑

bash
go run ./cmd/umctl --addr http://localhost:8080 query run demo ".topo | graph-call getDirectRelations([(:\"devops@devops.service\" {__entity_id__: '10000000000000000000000000000101'})]) | limit 10"

5. Explain 查询计划

bash
go run ./cmd/umctl --addr http://localhost:8080 query explain demo ".entity with(domain='devops', name='devops.service') | limit 5"

Explain 输出查询入口、provider、计划算子和 limit 信息。

6. 查看 Agent 元数据

bash
go run ./cmd/umctl --addr http://localhost:8080 agent discover demo
go run ./cmd/umctl --addr http://localhost:8080 agent tool demo query_spl_examples '{}'

7. 打开 Web UI

打开 http://localhost:5173,选择 demo workspace。

  • Explorer:查看 UModel 定义。
  • Query:运行 .umodel.entity.topo
  • Imports & Writes:导入模型、写入实体和关系。
  • Agent:查看 discovery、tools、resources 和 next actions。

8. 停止

bash
make stop-all

相关参考

基于 Apache-2.0 许可发布。