Semantic Integration Engine CLI

ASAMI, Tomoharu Created: 2025-12-29

The Semantic Integration Engine (SIE) is a semantic search engine that integrates a knowledge graph with vector-based retrieval.

In this series so far, we have introduced how to use SIE from multiple clients such as REST, ChatGPT, and VS Code (via MCP).

In this article, we focus on using SIE from the CLI as the simplest and most general-purpose approach among them.

The CLI functions as a “minimal client” that can be operated directly by humans and also invoked from shell scripts and generative AI.

Through a REST API–based CLI, we will explain how SIE’s semantic search capabilities can be used, accompanied by a practical demonstration.

Flow So Far

So far, we have explained the following approaches as clients for using the Semantic Integration Engine.

REST is an interface for exposing functionality to general-purpose applications.

For ChatGPT, we provided a WebSocket interface that ChatGPT uses.

Unlike general MCP clients, ChatGPT connects using its own protocol derived from JSON-RPC, so a dedicated interface is required.

We provided a WebSocket-based MCP interface for the Codex feature in VS Code.

CLI

This time, we created a CLI command to make the SEI functionality easily accessible from the console and shell scripts.

Architecture

The SIE server provides the following three interfaces.

  • REST API

  • MCP WebSocket

  • ChatGPT WebSocket

The ChatGPT WebSocket allows ChatGPT to connect using its own proprietary protocol (a JSON-RPC derivative).

The MCP WebSocket allows applications to connect directly using the MCP protocol, and it can also be invoked from commands that provide the MCP protocol over standard input and output. VS Code is assumed to use this route.

The REST API provides an interface for general-purpose applications.

The SIE CLI, which is the focus of this article, makes it possible to use the functions provided by the REST API as CLI (Command Line Interface) commands that can be executed directly in a shell or embedded into shell scripts.

Semantic Integration Engine Architecture
Figure 1. Semantic Integration Engine Architecture

Setup

Docker Compose is used to start the demo environment.

Copy the following docker-compose.yml , create a working directory, and save it there as docker-compose.yml .

services:
  #######################################################################
  # FUSEKI — RDF / SPARQL server
  #######################################################################
  fuseki:
    image: ghcr.io/asami/preload-fuseki:latest
    container_name: sie-fuseki
    platform: linux/amd64
    ports:
      - "9030:3030"
    restart: unless-stopped
    networks:
      - sie-net
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3030/ds/query?query=SELECT%20*%20WHERE%20%7B%20?s%20?p%20?o%20%7D%20LIMIT%201"]
      interval: 5s
      timeout: 3s
      retries: 20
      start_period: 10s
  #######################################################################
  # SIE-EMBEDDING — Lightweight embedding service
  #######################################################################
  sie-embedding:
    image: ghcr.io/asami/sie-embedding:latest
    container_name: sie-embedding
    ports:
      - "8081:8081"
    restart: unless-stopped
    networks:
      - sie-net
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
      interval: 3s
      timeout: 2s
      retries: 20
  #######################################################################
  # SIE — Semantic Integration Engine (Demo)
  #
  # NOTE:
  # - This demo explicitly uses application.demo.conf.
  # - Do NOT rely on the image default ENTRYPOINT/CMD for demo behavior.
  # - This preserves the historical demo behavior from docker-compose.demo.yml.
  #######################################################################
  sie:
    image: ghcr.io/asami/sie:0.2.0
    container_name: sie
    volumes:
      - .:/workspace/vscode-mcp
    depends_on:
      fuseki:
        condition: service_healthy
      sie-embedding:
        condition: service_healthy
    ports:
      - "9050:9050"   # HTTP + MCP WebSocket API (/mcp)
    environment:
      SIE_MODE: demo
      # ---- Application server mode (required) ----
      SERVER_MODE: demo
      # ---- MCP / VS Code workspace ----
      SIE_WORKSPACE_DIR: /workspace/vscode-mcp
      # ---- SIE configuration ----
      FUSEKI_URL: http://sie-fuseki:3030/ds
      SIE_EMBEDDING_MODE: "oss"
      SIE_EMBEDDING_ENDPOINT: http://sie-embedding:8081/embed
    command:
      - java
      - -Dconfig.file=/app/conf/application.demo.conf
      - -jar
      - /app/semantic-integration-engine.jar
    restart: unless-stopped
    networks:
      - sie-net
  #######################################################################
  # SIE-MCP — MCP stdio client (transient, non-daemon)
  #######################################################################
  sie-mcp:
    image: ghcr.io/asami/sie:0.2.0
    container_name: sie-mcp
    entrypoint: ["/opt/sie/bin/mcp-client"]
    stdin_open: true
    tty: false
    depends_on:
      sie:
        condition: service_started
    environment:
      MCP_WS_URL: ws://sie:9050/mcp
    networks:
      - sie-net
networks:
  sie-net:

Startup

Move to the working directory and start the demo using the Docker command as shown below.

$ docker compose up -d

Startup is complete once the following output is displayed.

[+] Running 5/5
 ✔ Network workd_sie-net    Created                                        0.0s
 ✔ Container sie-fuseki     Healthy                                        6.2s
 ✔ Container sie-embedding  Healthy                                       22.2s
 ✔ Container sie            Started                                       21.8s
 ✔ Container sie-mcp        Started                                       21.8s

Note that even after SIE has finished starting up, a background process continues to register HTML documents into the vector database, so it is advisable to wait a few minutes before running the demo.

Operations Environment

When SIE is started, the following files are created in the working directory.

  • .sie-workspace-initialized: A lock file

  • .vscode/settings.json: MCP configuration file for VSCode

  • bin/sie-mcp: The SIE MCP command

  • bin/sie-mcp: The SIE CLI command

The files .sie-workspace-initialized, .vscode/settings, and bin/sie-mcp are the same as in the previous setup.

The bin/sie-cli at the end is the SIE CLI.

Operation Verification

We use the sie-cli deployed via Docker Compose to access the functions provided by SIE.

We use the query command of the SIE CLI.

$ bin/sie-cli query "SimpleObject" | jq

As a result of the request, the following information related to the queried term is returned.

  • concepts: A list of related concepts.

  • passages: A list of related articles with descriptive text.

  • graph: The knowledge graph.

The graph (knowledge graph) contains a list of nodes that make up the knowledge graph in nodes, and a list of knowledge triples in edges.

bin/sie-cli query "SimpleObject" | jq
{
  "concepts": [
    {
      "uri": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
      "label": "SimpleObject",
      "lang": "en"
    }
  ],
  "passages": [
    {
      "id": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleobject.html#chunk-0",
      "text": "SimpleObject ASAMI, Tomoharu Term SimpleObject Aliases - Definition SimpleObject is an abstract object defined in the SimpleModeling Reference Profile that specifies common attributes for domain objects. It delegates generic attribute groups—such as NameAttributes and LifecycleAttributes—as value objects, making it reusable as a base class for both entity objects and value objects. SimpleEntity inherits from SimpleObject and adds attributes such as the identifier (id) required for persistence, forming the foundation of entity objects. Category Domain Modeling SimpleModeling Reference Profile Related Terms SimpleEntity Value Object Domain Object Attribute Group Related Articles SimpleObject",
      "score": 0.7675370573997498
    },
    {
      "id": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleentity.html#chunk-0",
      "text": "SimpleEntity ASAMI, Tomoharu Term SimpleEntity Aliases - Definition SimpleObject is an abstract object defined in the SimpleModeling Reference Profile that specifies common attributes for domain objects. SimpleEntity provides a comprehensive set of attributes commonly needed by entity objects, allowing designers to define entity objects by simply adding domain-specific attributes. Category Domain Modeling SimpleModeling Reference Profile Related Terms SimpleObject Value Object Domain Object Attribute Group Related Articles SimpleObject",
      "score": 0.7702887058258057
    },
    {
      "id": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-0",
      "text": "SimpleObject ASAMI, Tomoharu Created: 2025-09-15 Updated: 2025-12-15 In the SimpleModeling Reference Profile (SMRP), the abstract class SimpleEntity is defined as the base class for all entity objects. Except for special cases, all entity objects are expected to derive from SimpleEntity. SimpleEntity provides a comprehensive set of attributes commonly needed by entity objects, allowing designers to define entity objects by simply adding domain-specific attributes. SimpleObject is defined as the base class of SimpleEntity. SimpleObject is an abstract object in SimpleModeling that defines the common attributes of domain objects. Value objects can optionally use SimpleObject as their base class. SimpleObject is composed by delegating various generic attribute groups, each of which can also be",
      "score": 0.7750577330589294
    },
    {
      "id": "https://www.simplemodeling.org/en/blog/sm-mcp-chatgpt.html#chunk-19",
      "text": "  },\n      {\n        \"id\": \"https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-0\",\n        \"text\": \"SimpleObject ASAMI, Tomoharu Created: 2025-09-15 In the SimpleModeling Reference Profile, the abstract class SimpleEntity is defined as the base class for all entity objects. Except for special cases, all entity objects are expected to derive from SimpleEntity. SimpleEntity provides a comprehensive set of attributes commonly needed by entity objects, allowing designers to define entity objects by simply adding domain-specific attributes. SimpleObject is defined as the base class of SimpleEntity. SimpleObject is an abstract object in SimpleModeling that defines the common attributes of domain objects. Value objects can optionally use SimpleObject as their base class. S",
      "score": 0.8564751744270325
    },
    {
      "id": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-3",
      "text": "defines an id attribute required for persistence, which makes it unsuitable for non-persistent objects like value objects. To accommodate use with value objects, a separate class named SimpleObject was defined to hold only common attributes, and SimpleEntity was made a subclass of SimpleObject. Internationalization In this article, the file simpleobject.cml is prepared in both Japanese and English versions, but in actual operation, it is also possible to include both Japanese and English descriptions side by side as shown below. Tools can extract and utilize the respective Japanese and English descriptions as needed. References Glossary SimpleEntity SimpleObject is an abstract object defined in the SimpleModeling Reference Profile that specifies common attributes for domain objects. Simple",
      "score": 0.8827045559883118
    }
  ],
  "graph": {
    "nodes": [
      {
        "id": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "label": "SimpleObject",
        "kind": "concept"
      },
      {
        "id": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleobject.html#chunk-0",
        "label": "SimpleObject ASAMI, Tomoharu Term SimpleObject Aliases - Definition SimpleObject",
        "kind": "passage"
      },
      {
        "id": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleentity.html#chunk-0",
        "label": "SimpleEntity ASAMI, Tomoharu Term SimpleEntity Aliases - Definition SimpleObject",
        "kind": "passage"
      },
      {
        "id": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-0",
        "label": "SimpleObject ASAMI, Tomoharu Created: 2025-09-15 Updated: 2025-12-15 In the Simp",
        "kind": "passage"
      },
      {
        "id": "https://www.simplemodeling.org/en/blog/sm-mcp-chatgpt.html#chunk-19",
        "label": "  },\n      {\n        \"id\": \"https://www.simplemodeling.org/en/domain-modeling/si",
        "kind": "passage"
      },
      {
        "id": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-3",
        "label": "defines an id attribute required for persistence, which makes it unsuitable for ",
        "kind": "passage"
      }
    ],
    "edges": [
      {
        "source": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "target": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleobject.html#chunk-0",
        "relation": "related"
      },
      {
        "source": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "target": "https://www.simplemodeling.org/en/glossary/domain-modeling/simpleentity.html#chunk-0",
        "relation": "related"
      },
      {
        "source": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "target": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-0",
        "relation": "related"
      },
      {
        "source": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "target": "https://www.simplemodeling.org/en/blog/sm-mcp-chatgpt.html#chunk-19",
        "relation": "related"
      },
      {
        "source": "https://www.simplemodeling.org/glossary/domain-modeling/simpleobject",
        "target": "https://www.simplemodeling.org/en/domain-modeling/simple-object.html#chunk-3",
        "relation": "related"
      }
    ]
  }
}

We were able to use SIE’s functionality through the command.

VSCode

VS Code integration did not work well with MCP last time, but this time we tried approaching it using the CLI.

VS Code Codex has the ability to execute external commands, and we take advantage of this capability.

Although it is a bit forced, we directly instructed Codex to execute the CLI through a prompt.

Use bin/sie-cli query "SimpleObject" to retrieve information about SimpleObject and summarize the results.

As a result, the following output was produced based on the concepts, passages, and knowledge graph information obtained by executing the SIE CLI. This shows that the information retrieved from SIE is being properly interpreted.

SimpleObject Summary (from ./bin/sie-cli query "SimpleObject"):
SimpleObject is an abstract object in the SimpleModeling Reference Profile that defines common attributes for domain objects.
It delegates generic attribute groups such as NameAttributes and LifecycleAttributes as value objects, providing a structure that is easy to reuse.
SimpleEntity extends SimpleObject and adds properties such as id required for persistence, forming the foundation of an entity.
Value Objects can also use SimpleObject as a base class when appropriate.
Related terms include SimpleEntity, Value Object, Domain Object, and Attribute Group.

With the MCP protocol, generative AI determines and uses the capabilities provided by the MCP server based on information obtained from initialize and get_manifest.

Even when using a CLI, by preparing rule files such as RULE.md or providing capability information via prompts, it should be possible for generative AI to leverage it as a means of acquiring external knowledge.

Summary

In this article, we introduced the structure and behavior of a CLI built on top of the Semantic Integration Engine’s REST API.

By using the CLI, we confirmed that SIE’s query functionality can be invoked directly from the console or shell scripts, and that it can also be presented to generative AI as a means of acquiring external knowledge.

A REST-based CLI is one of SIE’s important usage patterns, useful both as a standalone tool and as a preliminary step toward more advanced integrations such as MCP and ChatGPT.

Going forward, we plan to explore more natural knowledge acquisition flows that combine the CLI, MCP, and generative AI.

References

Glossary

Semantic Integration Engine (SIE)

An integration engine that unifies structured knowledge (RDF) and document knowledge (SmartDox) derived from the BoK, making them directly accessible to AI.

knowledge graph

A semantic graph-based knowledge base where nodes represent entities or concepts and edges represent their relationships.

Prompt

A structured instruction or contextual representation that bridges retrieved knowledge (RAG) and the AI model’s reasoning process. It transforms the structured knowledge from the BoK into a narrative or directive form that the model can interpret, act upon, and internalize.