Skip to content

Externalized functions for Mercury Composable

Write the function in Python. Let the engine orchestrate it.

At a glance

  • What — a lightweight Event-over-HTTP function host and client: your Python functions become routes a Mercury Composable engine calls from Event Script flows and MiniGraph knowledge graphs, exactly as if they were local.
  • For teams whose business logic lives in Python — requests-style integrations, NumPy/pandas, ML inference - inside a composable, event-driven architecture.
  • Not an orchestrator. Flows, graphs, retries and state live in the engines; this package deliberately provides functions only.

The main theme, in one screen

Mercury Composable builds applications from self-contained functions wired by configuration — functions never call each other directly; they couple only through route names and event envelopes. The platform ascends three layers, each documented in the engine documentation:

Layer Idea Authority
1 — Event-driven Functions + route names + EventEnvelope over an in-memory event bus Event-driven Foundation
2 — Composable Event Script: YAML flows choreograph functions — orchestration is configuration, not code Composable Orchestration
3 — Knowledge Graph MiniGraph: an Active Knowledge Graph is the application — graphs execute behavior through skills Knowledge Graph

This site documents the fourth seat at that table: functions that live outside the engine — in a Python process — yet participate in layers 2 and 3 as first-class tasks. The seam is Event over HTTP: the same event envelope, carried over HTTP, addressed by the same route names.

flowchart LR
    subgraph Engine [Java or Rust engine]
      F[Event Script flow] --> R[route: hello.python]
      G[MiniGraph graph.task] --> R
    end
    R -- "Event-over-HTTP<br/>(one envelope, MsgPack)" --> H
    subgraph Host [Python function host]
      H[POST /api/event] --> B[event bus] --> P["@preload('hello.python')"]
    end

An engine flow or graph names the route hello.python; a one-entry declarative map points that route at your Python host; your function runs with trace context carried end to end. No engine code changes. No orchestration in Python.

Where to go next

Engine versions

Event Script flows call declarative Event-over-HTTP targets on any 4.x engine. MiniGraph graph.task targets require engine v4.11.11 or later (the release that taught the deployed-graph guard about the declarative map).