MachinaRuntime¶
MachinaRuntime is the headless façade used by the MCP server and other non-agent entry points. It owns a ConnectorRegistry and exposes connector lookup by name or by capability without dragging in the LLM, channels, or workflow engine that Agent carries.
Use Agent for conversational and workflow-driven scenarios. Use MachinaRuntime when you want to expose connector capabilities to an external orchestrator (MCP, custom server, batch script) and the LLM lives outside Machina.
MachinaRuntime ¶
MachinaRuntime(*, connectors: dict[str, BaseConnector] | None = None, sandbox_mode: bool = False, primary_cmms_name: str = '')
Runtime facade for connector lifecycle and capability routing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connectors
|
dict[str, BaseConnector] | None
|
Named connector instances. |
None
|
sandbox_mode
|
bool
|
If True, write operations should be blocked. |
False
|
primary_cmms_name
|
str
|
Name of the connector marked |
''
|
Example
from_config
classmethod
¶
Build a runtime from a MachinaConfig, instantiating connectors.
connect_all
async
¶
Connect all registered connectors.
Failed connectors are recorded in self.failed_connectors and
logged at ERROR level. The runtime continues with healthy connectors.
get_primary_cmms ¶
Return the primary CMMS connector.
If a connector is marked primary: true in config, it is
returned. Otherwise falls back to the first connector that
supports READ_ASSETS and logs a warning.
Raises:
| Type | Description |
|---|---|
ConnectorError
|
If no CMMS connector is configured. |
find_by_capability ¶
Find all connectors supporting a given capability.