tg-show-config

Displays the current TrustGraph system configuration.

Synopsis

tg-show-config [options]

Description

The tg-show-config command retrieves and displays the complete TrustGraph system configuration in JSON format. This includes flow definitions, service configurations, and other system settings stored in the configuration service.

This is particularly useful for:

  • Understanding the current system setup
  • Debugging configuration issues
  • Finding queue names for Pulsar integration
  • Verifying flow definitions and interfaces

Options

  • -u, --api-url URL: TrustGraph API URL (default: $TRUSTGRAPH_URL or http://localhost:8088/)

Examples

Display Complete Configuration

tg-show-config

Using Custom API URL

tg-show-config -u http://production:8088/

Output Format

The command outputs the configuration version followed by the complete configuration in JSON format:

Version: 42
{
    "flows": {
        "default": {
            "class-name": "document-rag+graph-rag",
            "description": "Default processing flow",
            "interfaces": {
                "agent": {
                    "request": "non-persistent://tg/request/agent:default",
                    "response": "non-persistent://tg/response/agent:default"
                },
                "graph-rag": {
                    "request": "non-persistent://tg/request/graph-rag:document-rag+graph-rag",
                    "response": "non-persistent://tg/response/graph-rag:document-rag+graph-rag"
                },
                "text-load": "persistent://tg/flow/text-document-load:default",
                ...
            }
        }
    },
    "prompts": {
        "system": "You are a helpful AI assistant...",
        "graph-rag": "Answer the question using the provided context..."
    },
    "token-costs": {
        "gpt-4": {
            "prompt": 0.03,
            "completion": 0.06
        }
    },
    ...
}

Configuration Sections

Flow Definitions

Flow configurations showing:

  • class-name: The flow class being used
  • description: Human-readable flow description
  • interfaces: Pulsar queue names for each service

Prompt Templates

System and service-specific prompt templates used by AI services.

Token Costs

Model pricing information for cost tracking and billing.

Service Settings

Various service-specific configuration parameters.

Finding Queue Names

The configuration output is essential for discovering Pulsar queue names:

Flow-Hosted Services

Look in the flows section under interfaces:

"graph-rag": {
    "request": "non-persistent://tg/request/graph-rag:document-rag+graph-rag",
    "response": "non-persistent://tg/response/graph-rag:document-rag+graph-rag"
}

Fire-and-Forget Services

Some services only have input queues:

"text-load": "persistent://tg/flow/text-document-load:default"

Error Handling

Connection Errors

Exception: Connection refused

Solution: Verify the API URL and ensure TrustGraph is running.

Authentication Errors

Exception: Unauthorized

Solution: Check authentication credentials and permissions.

Environment Variables

  • TRUSTGRAPH_URL: Default API URL

API Integration

This command uses the Config API with the config operation to retrieve the complete system configuration.

API Call:

{
    "operation": "config"
}

Use Cases

Development and Debugging

  • Verify flow configurations are correct
  • Check that services have proper queue assignments
  • Debug configuration-related issues

System Administration

  • Monitor configuration changes over time
  • Document current system setup
  • Prepare for system migrations

Integration Development

  • Discover Pulsar queue names for direct integration
  • Understand service interfaces and capabilities
  • Verify API endpoint configurations

Troubleshooting

  • Check if flows are properly configured
  • Verify prompt templates are set correctly
  • Confirm token cost configurations