diff --git a/docs/api.html b/docs/api.html index 201771ec..7cbddd32 100644 --- a/docs/api.html +++ b/docs/api.html @@ -12,413 +12,417 @@ margin: 0; } - -

TrustGraph API Gateway (1.8)

Download OpenAPI specification:

REST API for TrustGraph - an AI-powered knowledge graph and RAG system.

-

Overview

TrustGraph API Gateway (2.1)

Download OpenAPI specification:

REST API for TrustGraph - an AI-powered knowledge graph and RAG system.

+

Overview

Import/Export: Bulk data operations for triples, embeddings, entity contexts
  • WebSocket: Multiplexed interface for all services
  • -

    Service Types

    Service Types

  • AI services: agent, text-completion, prompt, RAG (document/graph)
  • Embeddings: embeddings, graph-embeddings, document-embeddings
  • -
  • Query: triples, objects, nlp-query, structured-query
  • +
  • Query: triples, rows, nlp-query, structured-query, row-embeddings
  • Data loading: text-load, document-load
  • Utilities: mcp-tool, structured-diag
  • -

    Authentication

    Authentication

    : Bearer <token>

    If GATEWAY_SECRET is not set, API runs without authentication (development mode).

    -

    Field Naming

    Field Naming

    All JSON fields use kebab-case: flow-id, blueprint-name, doc-limit, etc.

    -

    Error Responses

    Error Responses

    } } -

    Config

    Config

    Configuration management (global service)

    -

    Configuration service

    Configuration service

    Manage TrustGraph configuration including flows, prompts, token costs, parameter types, and more.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Manage TrustGraph configuration including flows, prompts, token costs, parameter types, and more.

    Operations

    config

    Get the complete system configuration including all flows, prompts, token costs, etc.

    @@ -576,7 +580,7 @@ The flow service (/api/v1/flow) manages runnin
  • Use config service to store/retrieve flow definitions
  • Use flow service to start/stop/manage running flows
  • -
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "config" "list" "get" "put" "delete"
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "config" "list" "get" "put" "delete"

    Operation to perform:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Operation to perform:

    • config: Get complete configuration
    • list: List all items of a specific type
    • @@ -592,25 +596,25 @@ The flow service (/api/v1/flow) manages runnin
    • put: Set/update configuration values
    • delete: Delete configuration items
    -
    type
    string
    type
    string

    Configuration type (required for list, get, put, delete operations). +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Configuration type (required for list, get, put, delete operations). Common types: flow, prompt, token-cost, parameter-type, interface-description

    -
    Array of objects

    Keys to retrieve (for get operation) or delete (for delete operation)

    -
    Array of objects

    Values to set/update (for put operation)

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "config"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "version": 42,
    • "config": {
      }
    }

    Flow

    Array of objects

    Keys to retrieve (for get operation) or delete (for delete operation)

    +
    Array of objects

    Values to set/update (for put operation)

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "config"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "version": 42,
    • "config": {
      }
    }

    Flow

    Flow lifecycle and blueprint management (global service)

    -

    Flow lifecycle and blueprint management

    Flow lifecycle and blueprint management

    Manage flow instances and blueprints.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Manage flow instances and blueprints.

    Important Distinction

    The flow service manages running flow instances. The config service (/api/v1/config) manages stored configuration.

    @@ -688,7 +692,7 @@ The config service (/api/v1/config) manages st

    delete-blueprint

    Delete a custom blueprint definition. Built-in blueprints cannot be deleted.

    -
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "start-flow" "stop-flow" "list-flows" "get-flow" "list-blueprints" "get-blueprint" "put-blueprint" "delete-blueprint"
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "start-flow" "stop-flow" "list-flows" "get-flow" "list-blueprints" "get-blueprint" "put-blueprint" "delete-blueprint"

    Flow operation:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Flow operation:

    • start-flow: Start a new flow instance from a blueprint
    • stop-flow: Stop a running flow instance
    • @@ -710,29 +714,29 @@ The config service (/api/v1/config) manages st
    • put-blueprint: Create/update blueprint definition
    • delete-blueprint: Delete blueprint definition
    -
    flow-id
    string

    Flow instance ID (required for start-flow, stop-flow, get-flow)

    -
    blueprint-name
    string

    Flow blueprint name (required for start-flow, get-blueprint, put-blueprint, delete-blueprint)

    -
    object

    Flow blueprint definition (required for put-blueprint)

    -
    description
    string

    Flow description (optional for start-flow)

    -
    object
    flow-id
    string

    Flow instance ID (required for start-flow, stop-flow, get-flow)

    +
    blueprint-name
    string

    Flow blueprint name (required for start-flow, get-blueprint, put-blueprint, delete-blueprint)

    +
    object

    Flow blueprint definition (required for put-blueprint)

    +
    description
    string

    Flow description (optional for start-flow)

    +
    object

    Flow parameters (for start-flow). +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Flow parameters (for start-flow). All values are stored as strings, regardless of input type.

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "start-flow",
    • "flow-id": "my-flow",
    • "blueprint-name": "document-rag",
    • "description": "My document processing flow",
    • "parameters": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "flow-id": "my-flow"
    }

    Librarian

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "start-flow",
    • "flow-id": "my-flow",
    • "blueprint-name": "document-rag",
    • "description": "My document processing flow",
    • "parameters": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "flow-id": "my-flow"
    }

    Librarian

    Document library management (global service)

    -

    Document library management

    Document library management

    Manage document library: add, remove, list documents, and control processing.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Manage document library: add, remove, list documents, and control processing.

    Document Library

    The librarian service manages a persistent library of documents that can be:

      @@ -780,7 +784,7 @@ for processing and handled asynchronously.

      Stop ongoing library document processing.

      list-processing

      List current processing tasks and their status.

      -
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "add-document" "remove-document" "list-documents" "start-processing" "stop-processing" "list-processing"
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "add-document" "remove-document" "list-documents" "start-processing" "stop-processing" "list-processing"

    Library operation:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Library operation:

    • add-document: Add document to library
    • remove-document: Remove document from library
    • @@ -798,35 +802,35 @@ for processing and handled asynchronously.

    • stop-processing: Stop library processing
    • list-processing: List processing status
    -
    flow
    string

    Flow ID

    -
    collection
    string
    Default: "default"

    Collection identifier

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    document-id
    string

    Document identifier

    -
    processing-id
    string

    Processing task identifier

    -
    object (DocumentMetadata)

    Document metadata for library management

    -
    object (ProcessingMetadata)

    Processing metadata for library document processing

    -
    content
    string

    Document content (for add-document with inline content)

    -
    Array of objects

    Search criteria for filtering documents

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "add-document",
    • "flow": "my-flow",
    • "collection": "default",
    • "document-metadata": {}
    }

    Response samples

    Content type
    application/json
    Example
    {}

    Knowledge

    flow
    string

    Flow ID

    +
    collection
    string
    Default: "default"

    Collection identifier

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    document-id
    string

    Document identifier

    +
    processing-id
    string

    Processing task identifier

    +
    object (DocumentMetadata)

    Document metadata for library management

    +
    object (ProcessingMetadata)

    Processing metadata for library document processing

    +
    content
    string

    Document content (for add-document with inline content)

    +
    Array of objects

    Search criteria for filtering documents

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "add-document",
    • "flow": "my-flow",
    • "collection": "default",
    • "document-metadata": {}
    }

    Response samples

    Content type
    application/json
    Example
    {}

    Knowledge

    Knowledge graph core management (global service)

    -

    Knowledge graph core management

    Knowledge graph core management

    Manage knowledge graph cores - persistent storage of triples and embeddings.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Manage knowledge graph cores - persistent storage of triples and embeddings.

    Knowledge Cores

    Knowledge cores are the foundational storage units for:

      @@ -890,7 +894,7 @@ Removes data from flow instance but doesn't delete the core.

    • Multiple messages with triples or graph-embeddings
    • Final message with eos: true to signal completion
    • -
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "list-kg-cores" "get-kg-core" "put-kg-core" "delete-kg-core" "load-kg-core" "unload-kg-core"
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "list-kg-cores" "get-kg-core" "put-kg-core" "delete-kg-core" "load-kg-core" "unload-kg-core"

    Knowledge core operation:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Knowledge core operation:

    • list-kg-cores: List knowledge cores for user
    • get-kg-core: Get knowledge core by ID
    • @@ -908,29 +912,29 @@ Removes data from flow instance but doesn't delete the core.

    • load-kg-core: Load knowledge core into flow
    • unload-kg-core: Unload knowledge core from flow
    -
    user
    string
    Default: "trustgraph"

    User identifier (for list-kg-cores, put-kg-core, delete-kg-core)

    -
    id
    string

    Knowledge core ID (for get, put, delete, load, unload)

    -
    flow
    string

    Flow ID (for load-kg-core)

    -
    collection
    string
    Default: "default"

    Collection identifier (for load-kg-core)

    -
    object

    Triples to store (for put-kg-core)

    -
    object

    Graph embeddings to store (for put-kg-core)

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "list-kg-cores",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "ids": [
      ]
    }

    Collection

    user
    string
    Default: "trustgraph"

    User identifier (for list-kg-cores, put-kg-core, delete-kg-core)

    +
    id
    string

    Knowledge core ID (for get, put, delete, load, unload)

    +
    flow
    string

    Flow ID (for load-kg-core)

    +
    collection
    string
    Default: "default"

    Collection identifier (for load-kg-core)

    +
    object

    Triples to store (for put-kg-core)

    +
    object

    Graph embeddings to store (for put-kg-core)

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "list-kg-cores",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "ids": [
      ]
    }

    Collection

    Collection metadata management (global service)

    -

    Collection metadata management

    Collection metadata management

    Manage collection metadata for organizing documents and knowledge.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Manage collection metadata for organizing documents and knowledge.

    Collections

    Collections are organizational units for grouping:

      @@ -982,45 +986,45 @@ If it exists, metadata is updated. Allows setting name, description, and tags.delete-collection

      Delete a collection by user and collection ID. This removes the metadata but typically does not delete the associated data (documents, knowledge cores).

      -
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "list-collections" "update-collection" "delete-collection"
    Authorizations:
    bearerAuth
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "list-collections" "update-collection" "delete-collection"

    Collection operation:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Collection operation:

    • list-collections: List collections for user
    • update-collection: Create or update collection metadata
    • delete-collection: Delete collection
    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string

    Collection identifier (for update, delete)

    -
    timestamp
    string <date-time>

    ISO timestamp

    -
    name
    string

    Human-readable collection name (for update)

    -
    description
    string

    Collection description (for update)

    -
    tags
    Array of strings

    Collection tags for organization (for update)

    -
    tag-filter
    Array of strings

    Filter collections by tags (for list)

    -
    limit
    integer
    Default: 0

    Maximum number of results (for list)

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "list-collections",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "timestamp": "2024-01-15T10:30:00Z",
    • "collections": [
      ]
    }

    Flow Services

    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string

    Collection identifier (for update, delete)

    +
    timestamp
    string <date-time>

    ISO timestamp

    +
    name
    string

    Human-readable collection name (for update)

    +
    description
    string

    Collection description (for update)

    +
    tags
    Array of strings

    Collection tags for organization (for update)

    +
    tag-filter
    Array of strings

    Filter collections by tags (for list)

    +
    limit
    integer
    Default: 0

    Maximum number of results (for list)

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "list-collections",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "timestamp": "2024-01-15T10:30:00Z",
    • "collections": [
      ]
    }

    Flow Services

    Services hosted within flow instances

    -

    Agent service - conversational AI with reasoning

    Agent service - conversational AI with reasoning

    AI agent that can understand questions, reason about them, and take actions.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    AI agent that can understand questions, reason about them, and take actions.

    Agent Overview

    The agent service provides a conversational AI that:

      @@ -1104,29 +1108,29 @@ Each step has: thought, action, arguments, observation.</p>

      Multi-turn Conversations

      Include history array with previous steps to maintain context. Each step has: thought, action, arguments, observation.

      -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    question
    required
    string

    User question or prompt for the agent

    -
    state
    string

    Agent state for continuation (optional, for multi-turn)

    -
    group
    Array of strings

    Group identifiers for collaborative agents (optional)

    -
    Array of objects

    Conversation history (optional, list of previous agent steps)

    -
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    -
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "What is the capital of France?",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "chunk-type": "thought",
    • "content": "I need to search for information about quantum computing",
    • "end-of-message": false,
    • "end-of-dialog": false
    }

    Document RAG - retrieve and generate from documents

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    question
    required
    string

    User question or prompt for the agent

    +
    state
    string

    Agent state for continuation (optional, for multi-turn)

    +
    group
    Array of strings

    Group identifiers for collaborative agents (optional)

    +
    Array of objects

    Conversation history (optional, list of previous agent steps)

    +
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "What is the capital of France?",
    • "user": "alice"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "chunk-type": "thought",
    • "content": "I need to search for information about quantum computing",
    • "end-of-message": false,
    • "end-of-dialog": false
    }

    Document RAG - retrieve and generate from documents

    Retrieval-Augmented Generation over document embeddings.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Retrieval-Augmented Generation over document embeddings.

    Document RAG Overview

    Document RAG combines:

      @@ -1192,27 +1196,27 @@ Each step has: thought, action, arguments, observation.

    1. collection: Target specific document collection
    2. user: Multi-tenant isolation
    3. -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    query
    required
    string

    User query or question

    -
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    -
    collection
    string
    Default: "default"

    Collection to search within

    -
    doc-limit
    integer [ 1 .. 100 ]
    Default: 20

    Maximum number of documents to retrieve

    -
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "What are the key findings in the research papers?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "The research papers present three key findings:\n1. Quantum entanglement exhibits non-local correlations\n2. Bell's inequality is violated in experimental tests\n3. Applications in quantum cryptography are promising\n",
    • "end-of-stream": false
    }

    Graph RAG - retrieve and generate from knowledge graph

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    query
    required
    string

    User query or question

    +
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    +
    collection
    string
    Default: "default"

    Collection to search within

    +
    doc-limit
    integer [ 1 .. 100 ]
    Default: 20

    Maximum number of documents to retrieve

    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "What are the key findings in the research papers?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "The research papers present three key findings:\n1. Quantum entanglement exhibits non-local correlations\n2. Bell's inequality is violated in experimental tests\n3. Applications in quantum cryptography are promising\n",
    • "end-of-stream": false
    }

    Graph RAG - retrieve and generate from knowledge graph

    Retrieval-Augmented Generation over knowledge graph.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Retrieval-Augmented Generation over knowledge graph.

    Graph RAG Overview

    Graph RAG combines:

      @@ -1302,33 +1306,33 @@ Each step has: thought, action, arguments, observation.

    1. Multi-hop reasoning ("What's the path from A to B?")
    2. Structural analysis ("What are the main entities related to X?")
    3. -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    query
    required
    string

    User query or question

    -
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    -
    collection
    string
    Default: "default"

    Collection to search within

    -
    entity-limit
    integer [ 1 .. 200 ]
    Default: 50

    Maximum number of entities to retrieve

    -
    triple-limit
    integer [ 1 .. 100 ]
    Default: 30

    Maximum number of triples to retrieve per entity

    -
    max-subgraph-size
    integer [ 10 .. 5000 ]
    Default: 1000

    Maximum total subgraph size (triples)

    -
    max-path-length
    integer [ 1 .. 5 ]
    Default: 2

    Maximum path length for graph traversal

    -
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "What connections exist between quantum physics and computer science?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "Quantum physics and computer science intersect primarily through quantum computing.\nThe knowledge graph shows connections through:\n- Quantum algorithms (Shor's algorithm, Grover's algorithm)\n- Quantum information theory\n- Computational complexity theory\n",
    • "end-of-stream": false
    }

    Text completion - direct LLM generation

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    query
    required
    string

    User query or question

    +
    user
    string
    Default: "trustgraph"

    User identifier for multi-tenancy

    +
    collection
    string
    Default: "default"

    Collection to search within

    +
    entity-limit
    integer [ 1 .. 200 ]
    Default: 50

    Maximum number of entities to retrieve

    +
    triple-limit
    integer [ 1 .. 100 ]
    Default: 30

    Maximum number of triples to retrieve per entity

    +
    max-subgraph-size
    integer [ 10 .. 5000 ]
    Default: 1000

    Maximum total subgraph size (triples)

    +
    max-path-length
    integer [ 1 .. 5 ]
    Default: 2

    Maximum path length for graph traversal

    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "What connections exist between quantum physics and computer science?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "Quantum physics and computer science intersect primarily through quantum computing.\nThe knowledge graph shows connections through:\n- Quantum algorithms (Shor's algorithm, Grover's algorithm)\n- Quantum information theory\n- Computational complexity theory\n",
    • "end-of-stream": false
    }

    Text completion - direct LLM generation

    Direct text completion using LLM without retrieval augmentation.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Direct text completion using LLM without retrieval augmentation.

    Text Completion Overview

    Pure LLM generation for:

      @@ -1422,23 +1426,23 @@ Each step has: thought, action, arguments, observation.

    • Want to leverage knowledge graph relationships
    • Require citations or provenance
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    system
    required
    string

    System prompt that sets behavior and context for the LLM

    -
    prompt
    required
    string

    User prompt or question

    -
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "system": "You are a helpful assistant that provides concise answers.",
    • "prompt": "Explain the concept of recursion in programming."
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "Recursion is a programming technique where a function calls itself\nto solve a problem by breaking it down into smaller, similar subproblems.\nEach recursive call works on a simpler version until reaching a base case.\n",
    • "in-token": 45,
    • "out-token": 128,
    • "model": "gpt-4",
    • "end-of-stream": false
    }

    Prompt service - template-based generation

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    system
    required
    string

    System prompt that sets behavior and context for the LLM

    +
    prompt
    required
    string

    User prompt or question

    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "system": "You are a helpful assistant that provides concise answers.",
    • "prompt": "Explain the concept of recursion in programming."
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "response": "Recursion is a programming technique where a function calls itself\nto solve a problem by breaking it down into smaller, similar subproblems.\nEach recursive call works on a simpler version until reaching a base case.\n",
    • "in-token": 45,
    • "out-token": 128,
    • "model": "gpt-4",
    • "end-of-stream": false
    }

    Prompt service - template-based generation

    Execute stored prompt templates with variable substitution.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Execute stored prompt templates with variable substitution.

    Prompt Service Overview

    The prompt service enables:

      @@ -1556,25 +1560,25 @@ Each step has: thought, action, arguments, observation.

    • Data transformation
    • Any repeatable LLM task with consistent prompting
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    id
    required
    string

    Prompt template ID (stored in config)

    -
    object

    Template variables as key-value pairs (values are JSON strings)

    -
    object

    Alternative to terms - variables as native JSON values (auto-converted)

    -
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "id": "summarize-document",
    • "terms": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "text": "This document provides an overview of quantum computing fundamentals and cryptographic applications.",
    • "end-of-stream": false
    }

    Embeddings - text to vector conversion

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    id
    required
    string

    Prompt template ID (stored in config)

    +
    object

    Template variables as key-value pairs (values are JSON strings)

    +
    object

    Alternative to terms - variables as native JSON values (auto-converted)

    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "id": "summarize-document",
    • "terms": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "text": "This document provides an overview of quantum computing fundamentals and cryptographic applications.",
    • "end-of-stream": false
    }

    Embeddings - text to vector conversion

    Convert text to embedding vectors for semantic similarity search.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Convert text to embedding vectors for semantic similarity search.

    Embeddings Overview

    Embeddings transform text into dense vector representations that:

      @@ -1630,19 +1634,19 @@ For bulk operations, use document-load or text-load services.</p>

      Single Request

      Unlike batch embedding APIs, this endpoint processes one text at a time. For bulk operations, use document-load or text-load services.

      -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    text
    required
    string

    Text to convert to embedding vector

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "text": "Machine learning"
    }

    Response samples

    Content type
    application/json
    {
    • "vectors": [
      ]
    }

    MCP Tool - execute Model Context Protocol tools

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    text
    required
    string

    Text to convert to embedding vector

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "text": "Machine learning"
    }

    Response samples

    Content type
    application/json
    {
    • "vectors": [
      ]
    }

    MCP Tool - execute Model Context Protocol tools

    Execute MCP (Model Context Protocol) tools for agent capabilities.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Execute MCP (Model Context Protocol) tools for agent capabilities.

    MCP Tool Overview

    MCP tools provide agent capabilities through standardized protocol:

      @@ -1734,21 +1738,21 @@ For bulk operations, use document-load or text-load services.

    • File operations: Read/write files
    • Code execution: Run scripts
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    name
    required
    string

    Tool name to execute

    -
    object

    Tool parameters (JSON object, auto-converted to string internally)

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "name": "search",
    • "parameters": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "text": "The result is 309"
    }

    Triples query - pattern-based graph queries

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    name
    required
    string

    Tool name to execute

    +
    object

    Tool parameters (JSON object, auto-converted to string internally)

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "name": "search",
    • "parameters": {
      }
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "text": "The result is 309"
    }

    Triples query - pattern-based graph queries

    Query knowledge graph using subject-predicate-object patterns.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Query knowledge graph using subject-predicate-object patterns.

    Triples Query Overview

    Query RDF triples with flexible pattern matching:

      @@ -1840,38 +1844,54 @@ For bulk operations, use document-load or text-load services.

    • More specific patterns = faster queries
    • Consider limit for large result sets
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    object (RdfValue)

    Subject filter (optional)

    -
    object (RdfValue)

    Predicate filter (optional)

    -
    object (RdfValue)

    Object filter (optional)

    -
    limit
    integer [ 1 .. 100000 ]
    Default: 10000

    Maximum number of triples to return

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection to query

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {}

    Response samples

    Content type
    application/json
    {}

    Objects query - GraphQL over knowledge graph

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    object (RdfValue)

    Subject filter (optional)

    +
    object (RdfValue)

    Predicate filter (optional)

    +
    object (RdfValue)

    Object filter (optional)

    +
    limit
    integer [ 1 .. 100000 ]
    Default: 10000

    Maximum number of triples to return

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to query

    +
    g
    string

    Named graph filter (optional).

    +
      +
    • Omitted/null: all graphs
    • +
    • Empty string: default graph only
    • +
    • URI string: specific named graph (e.g., urn:graph:source, urn:graph:retrieval)
    • +
    +
    streaming
    boolean
    Default: false

    Enable streaming response delivery

    +
    batch-size
    integer [ 1 .. 1000 ]
    Default: 20

    Number of triples per streaming batch

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {}

    Response samples

    Content type
    application/json
    {}

    Rows query - GraphQL over structured data

    Query knowledge graph using GraphQL for object-oriented data access.

    -

    Objects Query Overview

    -

    GraphQL interface to knowledge graph:

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Query structured data using GraphQL for row-oriented data access.

    +

    Rows Query Overview

    +

    GraphQL interface to structured data:

    • Schema-driven: Predefined types and relationships
    • Flexible queries: Request exactly what you need
    • Nested data: Traverse relationships in single query
    • Type-safe: Strong typing with introspection
    -

    Abstracts RDF triples into familiar object model.

    +

    Abstracts structured rows into familiar object model.

    GraphQL Benefits

    Compared to triples query:

      @@ -1956,27 +1976,27 @@ Use introspection query to discover schema.</p>

      Schema Definition

      Schema defines available types via config service. Use introspection query to discover schema.

      -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    query
    required
    string

    GraphQL query string

    -
    object

    GraphQL query variables

    -
    operation-name
    string

    Operation name (for multi-operation documents)

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection to query

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "{\n person(id: \"https://example.com/person/alice\") {\n name\n email\n }\n}\n",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "data": {
      },
    • "extensions": {
      }
    }

    NLP Query - natural language to structured query

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    query
    required
    string

    GraphQL query string

    +
    object

    GraphQL query variables

    +
    operation-name
    string

    Operation name (for multi-operation documents)

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to query

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "query": "{\n person(id: \"https://example.com/person/alice\") {\n name\n email\n }\n}\n",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "data": {
      },
    • "extensions": {
      }
    }

    NLP Query - natural language to structured query

    Convert natural language questions to structured GraphQL queries.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Convert natural language questions to structured GraphQL queries.

    NLP Query Overview

    Transforms user questions into executable GraphQL:

      @@ -2056,7 +2076,7 @@ Use introspection query to discover schema.

      Example workflow:

      1. User asks: "Who does Alice know?"
       2. NLP Query generates GraphQL
      -3. Execute via /api/v1/flow/{flow}/service/objects
      +3. Execute via /api/v1/flow/{flow}/service/rows
       4. Return results to user
       

      Schema Detection

      @@ -2080,26 +2100,26 @@ Use introspection query to discover schema.

    • Missing schema coverage
    • Complex query structure
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    question
    required
    string

    Natural language question

    -
    max-results
    integer [ 1 .. 10000 ]
    Default: 100

    Maximum results to return when query is executed

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "Who does Alice know?",
    • "max-results": 50
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "graphql-query": "query GetConnections($person: ID!) {\n person(id: $person) {\n knows { name email }\n }\n}\n",
    • "variables": {},
    • "detected-schemas": [
      ],
    • "confidence": 0.92
    }

    Structured Query - question to results (all-in-one)

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    question
    required
    string

    Natural language question

    +
    max-results
    integer [ 1 .. 10000 ]
    Default: 100

    Maximum results to return when query is executed

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "Who does Alice know?",
    • "max-results": 50
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "graphql-query": "query GetConnections($person: ID!) {\n person(id: $person) {\n knows { name email }\n }\n}\n",
    • "variables": {},
    • "detected-schemas": [
      ],
    • "confidence": 0.92
    }

    Structured Query - question to results (all-in-one)

    Ask natural language questions and get results directly.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Ask natural language questions and get results directly.

    Structured Query Overview

    Combines two operations in one call:

    1. NLP Query: Generate GraphQL from question
    2. -
    3. Objects Query: Execute generated query
    4. +
    5. Rows Query: Execute generated query
    6. Return Results: Direct answer data

    Simplest way to query knowledge graph with natural language.

    @@ -2170,7 +2190,7 @@ Use introspection query to discover schema.

  • Output: Query results (data)
  • Use when: Want simple, direct answers
  • -

    NLP Query + Objects Query (separate calls)

    +

    NLP Query + Rows Query (separate calls)

    • Step 1: Convert question → GraphQL
    • Step 2: Execute GraphQL → results
    • @@ -2214,23 +2234,23 @@ Use introspection query to discover schema.

    • Less control: Can't inspect/modify generated query
    • Simpler code: No need to handle intermediate steps
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    question
    required
    string

    Natural language question

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection to query

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "Who does Alice know?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "data": {
      },
    • "errors": [ ]
    }

    Structured Diag - analyze structured data formats

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    question
    required
    string

    Natural language question

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to query

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "question": "Who does Alice know?",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "data": {
      },
    • "errors": [ ]
    }

    Structured Diag - analyze structured data formats

    Analyze and understand structured data (CSV, JSON, XML).

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Analyze and understand structured data (CSV, JSON, XML).

    Structured Diag Overview

    Helps process unknown structured data:

      @@ -2352,39 +2372,39 @@ Use introspection query to discover schema.

    • Use descriptor to process full dataset
    • Load data via document-load or text-load
    • -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "detect-type" "generate-descriptor" "diagnose" "schema-selection"
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    operation
    required
    string
    Enum: "detect-type" "generate-descriptor" "diagnose" "schema-selection"

    Diagnosis operation:

    +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

    Diagnosis operation:

    • detect-type: Identify data format (CSV, JSON, XML)
    • generate-descriptor: Create schema descriptor for data
    • diagnose: Full analysis (detect + generate descriptor)
    • schema-selection: Find matching schemas for data
    -
    sample
    required
    string

    Data sample to analyze (text content)

    -
    type
    string
    Enum: "csv" "json" "xml"

    Data type (required for generate-descriptor)

    -
    schema-name
    string

    Target schema name for descriptor generation (optional)

    -
    object

    Format-specific options (e.g., CSV delimiter)

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "detect-type",
    • "sample": "name,age,email\nAlice,30,alice@example.com\nBob,25,bob@example.com\n"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "operation": "detect-type",
    • "detected-type": "csv",
    • "confidence": 0.95
    }

    Graph Embeddings Query - find similar entities

    sample
    required
    string

    Data sample to analyze (text content)

    +
    type
    string
    Enum: "csv" "json" "xml"

    Data type (required for generate-descriptor)

    +
    schema-name
    string

    Target schema name for descriptor generation (optional)

    +
    object

    Format-specific options (e.g., CSV delimiter)

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "operation": "detect-type",
    • "sample": "name,age,email\nAlice,30,alice@example.com\nBob,25,bob@example.com\n"
    }

    Response samples

    Content type
    application/json
    Example
    {
    • "operation": "detect-type",
    • "detected-type": "csv",
    • "confidence": 0.95
    }

    Graph Embeddings Query - find similar entities

    Query graph embeddings to find similar entities by vector similarity.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Query graph embeddings to find similar entities by vector similarity.

    Graph Embeddings Query Overview

    Find entities semantically similar to a query vector:

      @@ -2460,25 +2480,25 @@ Use introspection query to discover schema.

    • These are references to knowledge graph entities
    • Use with triples query to get entity details
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    vectors
    required
    Array of numbers

    Query embedding vector

    -
    limit
    integer [ 1 .. 1000 ]
    Default: 10

    Maximum number of entities to return

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection to search

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "vectors": [
      ],
    • "limit": 10,
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json

    Document Embeddings Query - find similar text chunks

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    vectors
    required
    Array of numbers

    Query embedding vector

    +
    limit
    integer [ 1 .. 1000 ]
    Default: 10

    Maximum number of entities to return

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to search

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "vectors": [
      ],
    • "limit": 10,
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json

    Document Embeddings Query - find similar text chunks

    Query document embeddings to find similar text chunks by vector similarity.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Query document embeddings to find similar text chunks by vector similarity.

    Document Embeddings Query Overview

    Find document chunks semantically similar to a query vector:

      @@ -2570,25 +2590,113 @@ Use introspection query to discover schema.

    • No metadata (source, position, etc.)
    • Use for LLM context directly
    -
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    vectors
    required
    Array of numbers

    Query embedding vector

    -
    limit
    integer [ 1 .. 1000 ]
    Default: 10

    Maximum number of document chunks to return

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection to search

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "vectors": [
      ],
    • "limit": 10,
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    {
    • "chunks": [
      ]
    }

    Text Load - load text documents

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    vectors
    required
    Array of numbers

    Query embedding vector

    +
    limit
    integer [ 1 .. 1000 ]
    Default: 10

    Maximum number of document chunks to return

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to search

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "vectors": [
      ],
    • "limit": 10,
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    {
    • "chunks": [
      ]
    }

    Row Embeddings Query - semantic search on structured data

    Query row embeddings to find similar rows by vector similarity on indexed fields. +Enables fuzzy/semantic matching on structured data.

    +

    Row Embeddings Query Overview

    +

    Find rows whose indexed field values are semantically similar to a query:

    +
      +
    • Input: Query embedding vector, schema name, optional index filter
    • +
    • Search: Compare against stored row index embeddings
    • +
    • Output: Matching rows with index values and similarity scores
    • +
    +

    Core component of semantic search on structured data.

    +

    Use Cases

    +
      +
    • Fuzzy name matching: Find customers by approximate name
    • +
    • Semantic field search: Find products by description similarity
    • +
    • Data deduplication: Identify potential duplicate records
    • +
    • Entity resolution: Match records across datasets
    • +
    +

    Process

    +
      +
    1. Obtain query embedding (via embeddings service)
    2. +
    3. Query stored row index embeddings for the specified schema
    4. +
    5. Calculate cosine similarity
    6. +
    7. Return top N most similar index entries
    8. +
    9. Use index values to retrieve full rows via GraphQL
    10. +
    +

    Response Format

    +

    Each match includes:

    +
      +
    • index_name: The indexed field(s) that matched
    • +
    • index_value: The actual values for those fields
    • +
    • text: The text that was embedded
    • +
    • score: Similarity score (higher = more similar)
    • +
    +
    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    vectors
    required
    Array of numbers

    Query embedding vector

    +
    schema_name
    required
    string

    Schema name to search within

    +
    index_name
    string

    Optional index name to filter search to specific index

    +
    limit
    integer [ 1 .. 1000 ]
    Default: 10

    Maximum number of matches to return

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection to search

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "vectors": [
      ],
    • "schema_name": "customers",
    • "limit": 10,
    • "user": "alice",
    • "collection": "sales"
    }

    Response samples

    Content type
    application/json
    {
    • "matches": [
      ]
    }

    Text Load - load text documents

    Load text documents into processing pipeline for indexing and embedding.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Load text documents into processing pipeline for indexing and embedding.

    Text Load Overview

    Fire-and-forget document loading:

      @@ -2682,29 +2790,29 @@ encoded = base64
      Authorizations:
      bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    text
    required
    string <byte>

    Text content (base64 encoded)

    -
    id
    string

    Document identifier

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection for document

    -
    charset
    string
    Default: "utf-8"

    Text character encoding

    -
    Array of objects (Triple)

    Document metadata as RDF triples

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "text": "VGhpcyBpcyB0aGUgZG9jdW1lbnQgdGV4dC4uLg==",
    • "id": "doc-123",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    { }

    Document Load - load binary documents (PDF, etc.)

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    text
    required
    string <byte>

    Text content (base64 encoded)

    +
    id
    string

    Document identifier

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection for document

    +
    charset
    string
    Default: "utf-8"

    Text character encoding

    +
    Array of objects (Triple)

    Document metadata as RDF triples

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "text": "VGhpcyBpcyB0aGUgZG9jdW1lbnQgdGV4dC4uLg==",
    • "id": "doc-123",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    { }

    Document Load - load binary documents (PDF, etc.)

    Load binary documents (PDF, Word, etc.) into processing pipeline.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Load binary documents (PDF, Word, etc.) into processing pipeline.

    Document Load Overview

    Fire-and-forget binary document loading:

      @@ -2814,29 +2922,61 @@ encoded = base64
      Authorizations:
      bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    -
    Request Body schema: application/json
    required
    data
    required
    string <byte>

    Document data (base64 encoded)

    -
    id
    string

    Document identifier

    -
    user
    string
    Default: "trustgraph"

    User identifier

    -
    collection
    string
    Default: "default"

    Collection for document

    -
    Array of objects (Triple)

    Document metadata as RDF triples

    -

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "data": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvS2lkc1szIDAgUl0vQ291bnQgMT4+ZW5kb2JqCg==",
    • "id": "doc-789",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    { }

    Import/Export

    Authorizations:
    bearerAuth
    path Parameters
    flow
    required
    string
    Example: my-flow

    Flow instance ID

    +
    Request Body schema: application/json
    required
    data
    required
    string <byte>

    Document data (base64 encoded)

    +
    id
    string

    Document identifier

    +
    user
    string
    Default: "trustgraph"

    User identifier

    +
    collection
    string
    Default: "default"

    Collection for document

    +
    Array of objects (Triple)

    Document metadata as RDF triples

    +

    Responses

    Request samples

    Content type
    application/json
    Example
    {
    • "data": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvS2lkc1szIDAgUl0vQ291bnQgMT4+ZW5kb2JqCg==",
    • "id": "doc-789",
    • "user": "alice",
    • "collection": "research"
    }

    Response samples

    Content type
    application/json
    { }

    Import/Export

    Bulk data import and export

    -

    Import Core - bulk import triples and embeddings

    Stream document content from library

    Streams the raw content of a document stored in the library. +Returns the document content in chunked transfer encoding.

    +

    Parameters

    +
      +
    • user: User identifier (required)
    • +
    • document-id: Document IRI to retrieve (required)
    • +
    • chunk-size: Size of each response chunk in bytes (optional, default: 1MB)
    • +
    +
    Authorizations:
    bearerAuth
    query Parameters
    user
    required
    string
    Example: user=trustgraph

    User identifier

    +
    document-id
    required
    string
    Example: document-id=urn:trustgraph:doc:abc123

    Document IRI to retrieve

    +
    chunk-size
    integer
    Default: 1048576

    Chunk size in bytes (default 1MB)

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    Import Core - bulk import triples and embeddings

    Import knowledge cores in bulk using streaming MessagePack format.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Import knowledge cores in bulk using streaming MessagePack format.

    Import Core Overview

    Bulk data import for knowledge graph:

      @@ -2944,21 +3084,21 @@ No response body - returns 202 Accepted.

    • Bulk loading: Initial knowledge base population
    • Replication: Copy knowledge cores
    -
    Authorizations:
    bearerAuth
    query Parameters
    id
    required
    string
    Example: id=core-123

    Knowledge core ID to import

    -
    user
    required
    string
    Example: user=alice

    User identifier

    -
    Request Body schema: application/msgpack
    required
    string <binary>

    MessagePack stream of knowledge data

    -

    Responses

    Response samples

    Content type
    application/json
    { }

    Export Core - bulk export triples and embeddings

    Authorizations:
    bearerAuth
    query Parameters
    id
    required
    string
    Example: id=core-123

    Knowledge core ID to import

    +
    user
    required
    string
    Example: user=alice

    User identifier

    +
    Request Body schema: application/msgpack
    required
    string <binary>

    MessagePack stream of knowledge data

    +

    Responses

    Response samples

    Content type
    application/json
    { }

    Export Core - bulk export triples and embeddings

    Export knowledge cores in bulk using streaming MessagePack format.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Export knowledge cores in bulk using streaming MessagePack format.

    Export Core Overview

    Bulk data export for knowledge graph:

      @@ -3082,21 +3222,21 @@ No response body - returns 202 Accepted.

    • Replication: Copy knowledge cores
    • Analysis: External processing
    -
    Authorizations:
    bearerAuth
    query Parameters
    id
    required
    string
    Example: id=core-123

    Knowledge core ID to export

    -
    user
    required
    string
    Example: user=alice

    User identifier

    -

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    WebSocket

    Authorizations:
    bearerAuth
    query Parameters
    id
    required
    string
    Example: id=core-123

    Knowledge core ID to export

    +
    user
    required
    string
    Example: user=alice

    User identifier

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    WebSocket

    WebSocket interfaces

    -

    WebSocket - multiplexed service interface

    WebSocket - multiplexed service interface

    WebSocket interface providing multiplexed access to all TrustGraph services over a single persistent connection.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    WebSocket interface providing multiplexed access to all TrustGraph services over a single persistent connection.

    Overview

    The WebSocket API provides access to the same services as the REST API but with:

      @@ -3382,21 +3522,21 @@ See individual service documentation for detailed request/response formats.

    • True streaming: Bidirectional real-time communication
    • Efficient multiplexing: Concurrent operations without connection pooling
    -
    Authorizations:
    bearerAuth
    header Parameters
    Upgrade
    required
    string
    Value: "websocket"

    WebSocket upgrade header

    -
    Connection
    required
    string
    Value: "Upgrade"

    Connection upgrade header

    -

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    Metrics

    Authorizations:
    bearerAuth
    header Parameters
    Upgrade
    required
    string
    Value: "websocket"

    WebSocket upgrade header

    +
    Connection
    required
    string
    Value: "Upgrade"

    Connection upgrade header

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    Metrics

    System metrics and monitoring

    -

    Metrics - Prometheus metrics endpoint

    Metrics - Prometheus metrics endpoint

    Proxy to Prometheus metrics for system monitoring.

    +" class="sc-iKGpAq sc-cCYyou dXXcln dHaogz">

    Proxy to Prometheus metrics for system monitoring.

    Metrics Overview

    Exposes system metrics via Prometheus format:

      @@ -3464,29 +3604,29 @@ metric_name{labelPath Parameter

      The {path} parameter allows querying specific Prometheus endpoints or metrics if the backend Prometheus supports it.

      -
    Authorizations:
    bearerAuth

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    Metrics - Prometheus metrics with path

    Proxy to Prometheus metrics with optional path parameter.

    -
    Authorizations:
    bearerAuth
    path Parameters
    path
    required
    string
    Example: query

    Path to specific metrics endpoint

    -

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }
    +
    Authorizations:
    bearerAuth

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }

    Metrics - Prometheus metrics with path

    Proxy to Prometheus metrics with optional path parameter.

    +
    Authorizations:
    bearerAuth
    path Parameters
    path
    required
    string
    Example: query

    Path to specific metrics endpoint

    +

    Responses

    Response samples

    Content type
    application/json
    {
    • "error": "Unauthorized"
    }
    + const config = {"show":{"sidebar":true},"sidebar":{"showOperations":"byDefault"}}; + const appRoot = document.getElementById('root'); + AsyncApiStandalone.render( + { schema, config, }, appRoot + ); + \ No newline at end of file diff --git a/specs/build-docs.sh b/specs/build-docs.sh index 3425b339..5e156913 100755 --- a/specs/build-docs.sh +++ b/specs/build-docs.sh @@ -24,7 +24,7 @@ echo # Build WebSocket API documentation echo "Building WebSocket API documentation (AsyncAPI)..." cd ../websocket -npx --yes -p @asyncapi/cli asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template@3.0.0 --use-new-generator -o /tmp/asyncapi-build -p singleFile=true --force-write +npx --yes -p @asyncapi/cli asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o /tmp/asyncapi-build -p singleFile=true --force-write mv /tmp/asyncapi-build/index.html ../../docs/websocket.html rm -rf /tmp/asyncapi-build echo "✓ WebSocket API docs generated: docs/websocket.html"