Skip to content

Latest commit

 

History

History
123 lines (93 loc) · 3.1 KB

File metadata and controls

123 lines (93 loc) · 3.1 KB

Runtime Flow

中文:运行时流程

Runtime paths for startup, model import, entity/relation writes, Query Service, AgentGateway, and MCP.

Startup

sequenceDiagram
  participant Main as umodel-server
  participant Bootstrap as internal/bootstrap
  participant Workspace as Workspace Store
  participant Graph as GraphStore Provider
  participant HTTP as REST Router

  Main->>Bootstrap: parse flags and build app
  Bootstrap->>Graph: select provider
  Bootstrap->>Workspace: initialize workspace persistence
  Bootstrap->>HTTP: register routes and UI handler
  HTTP-->>Main: listen on address
Loading

Runtime flags:

Flag Meaning
--addr API listen address, for example :8080.
--data Local data root.
--graphstore Provider name: memory, file.memory, or local.ladybug.

Model Import

sequenceDiagram
  participant Client
  participant API as REST API
  participant UModel as UModel Service
  participant Validator as Schema Validator
  participant Graph as GraphStore

  Client->>API: POST /api/v1/umodel/{workspace}/import
  API->>UModel: import path or pack
  UModel->>Validator: validate elements
  Validator-->>UModel: validation result
  UModel->>Graph: put UModel elements
  Graph-->>UModel: write result
  UModel-->>Client: import result
Loading

The bundled multi-domain quickstart sample uses the same path, wrapped by:

POST /api/v1/samples/{workspace}/multi-domain-quickstart:import

Entity And Relation Writes

sequenceDiagram
  participant Client
  participant API
  participant Store as EntityStore
  participant Graph as GraphStore

  Client->>API: entities:write or relations:write
  API->>Store: validate workspace and payload
  Store->>Graph: write records
  Graph-->>Store: write result
  Store-->>Client: accepted / failed items
Loading

EntityStore is write-oriented. Runtime reads go through Query Service.

Query Execution

sequenceDiagram
  participant Client
  participant API
  participant Query as Query Service
  participant Planner as Parser and planner
  participant Graph as GraphStore

  Client->>API: POST /api/v1/query/{workspace}/execute
  API->>Query: query request
  Query->>Planner: parse SPL
  Planner-->>Query: source and operators
  Query->>Graph: read model/entity/topology data
  Graph-->>Query: rows
  Query-->>Client: rows and explain metadata
Loading

AgentGateway And MCP

AgentGateway exposes a safe agent-facing layer:

  • Discovery lists tools, resources, and next actions.
  • Query tools execute or explain SPL.
  • Resources expose metadata and templates.
  • Write tools stay disabled unless explicitly enabled.

umodel-mcp connects MCP clients to the same AgentGateway semantics used by REST.

Local Persistence

With file.memory, GraphStore data is saved under:

data/graphstore/file-memory/workspaces/<workspace>/
├── umodels.json
├── entities.json
└── relations.json

Workspace metadata is saved separately at:

data/workspaces.json

Storage details: Storage And GraphStore Providers.