Zum Inhalt springen

Architekturüberblick

Greentic folgt einer geschichteten Architektur mit klarer Trennung der Zuständigkeiten:

┌─────────────────────────────────────────────────────────┐
│ Messaging Channels │
│ (Slack, Teams, Telegram, WhatsApp, WebChat) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ Gateway (HTTP/NATS) │
│ Public Endpoint Router │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ greentic-runner │
│ (Production Runtime Host) │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Flow Executor │ │
│ │ (Wasmtime Component Model) │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Session Manager │ │
│ │ (Memory / Redis) │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ WASM Components │
│ (Flows, Providers, MCP Tools, Custom Components) │
└─────────────────────────────────────────────────────────┘

greentic-runner

Die zentrale Produktions-Runtime, die Flows hostet und ausführt, Sessions verwaltet und alle Plattformdienste koordiniert.

greentic-flow

Flow-Schemadefinition, Intermediate Representation (IR), Loader und Validator für .ygtc-Dateien.

greentic-pack

Pack-Builder-CLI zum Erstellen signierter .gtpack-Archive mit Flows, Komponenten und Assets.

greentic-component

CLI zum Erstellen von Komponenten und Runtime-Hilfsprogramme zum Bauen von WASM-Komponenten.

EbeneTechnologieZweck
WASM RuntimeWasmtime v41Ausführung des Component Model
Async RuntimeTokio v1Asynchrone I/O, Task-Scheduling
HTTP ServerAxum v0.8REST-API, Webhooks
Message BusNATSEreignisverteilung, Pub/Sub
Session StoreMemory/RedisPersistenz des Flow-Zustands
SecretsAWS/Azure/GCP/VaultVerwaltung von Anmeldedaten
1. External Message (e.g., Slack)
2. Webhook Handler (Provider Ingress)
3. NATS: greentic.messaging.ingress.{env}.{tenant}.{team}.{channel}
4. Flow Router (tenant/team resolution)
5. Flow Executor (WASM component execution)
6. Session State Update
7. Reply/Action Nodes
8. NATS: greentic.messaging.egress.{env}.{tenant}.{team}.{channel}
9. Provider Egress → External Service
1. Bundle Configuration (greentic.demo.yaml)
2. Pack Resolver (local/OCI registry)
3. Signature Verification (ed25519-dalek)
4. CBOR Metadata Parsing
5. WASM Component Instantiation
6. WIT Interface Binding
7. Runtime Registration

Greentic implementiert Tenant-Isolation auf jeder Ebene:

Tenant
└── Environment (prod, staging, dev)
└── Team
└── Channel (messaging provider instance)
└── Session (user conversation state)

Die TenantCtx-Struktur fließt durch alle Operationen:

pub struct TenantCtx {
pub tenant_id: String,
pub env_id: String,
pub team_id: Option<String>,
}

Greentic verwendet die Spezifikation WebAssembly Interface Types (WIT) zur Definition von Komponentenschnittstellen:

greentic-interfaces/wit/component.wit
package greentic:component;
interface types {
record message {
id: string,
content: string,
sender: string,
timestamp: u64,
}
record outcome {
success: bool,
data: option<string>,
error: option<string>,
}
}
world component {
import types;
export execute: func(input: types.message) -> types.outcome;
}
greentic-types ─────────────────────────── (foundation)
greentic-telemetry
greentic-interfaces ← greentic-types
greentic-config ← greentic-types
greentic-session ← greentic-types
greentic-state ← greentic-types + greentic-interfaces
greentic-flow ← greentic-interfaces + greentic-types
greentic-pack ← greentic-flow + greentic-types
greentic-component ← greentic-interfaces + greentic-types
greentic-mcp ← greentic-interfaces + greentic-types
greentic-runner ← ALL of the above

Greentic verwendet OpenTelemetry für verteiltes Tracing und Metriken:

  • Tracing: OTLP-Exporter für verteilte Trace-Korrelation
  • Metrics: Flow-Ausführungszeiten, Nachrichtendurchsatz, Fehlerraten
  • Logging: Strukturiertes Logging mit Trace-Kontext
  • Flows - Lernen Sie Flow-Definitionen kennen
  • Packs - Verstehen Sie die Pack-Struktur
  • Komponenten - Erstellen Sie benutzerdefinierte WASM-Komponenten