How do Modules interact with the Module Runtime?
When you deploy a module into Kodexa you include the module runtime that you want to use. Today, all Kodexa module runtimes have the same interface, but this may change in the future. There are two primary forms of interaction between the module runtime and the module. The first is inference, the second is training. How the module runtime calls your module is based on how you have declared your module in the module.yml file.Inference
The most common starting point with working with a module is learning how inference works. Let’s take a simple example of a module.yml:moduleRuntimeRef which is set to kodexa/base-module-runtime. This means that the Robotic Assistant will use the base module runtime to run the module. In fact, it will look up the module runtime with the ref kodexa/base-module-runtime. Then it will look at the module runtime to determine which action it uses for inference, and build a pipeline including that action. The platform will then schedule that pipeline and then module runtime action will be called.

Module and then look for a function in that package called infer.
The module runtime will pass the document that we are processing to the module and then the module will return a document. The module runtime will then pass the document back to the platform for further processing.
Inference with Options
In the previous example, we saw how the module runtime would pass the document to the module. In this example, we will see how the module runtime will pass options to the module. First, let’s add some inference options to our module.yml file:Overriding Entry Points
If you want to override the entry point for your module, you can do so by specifying themoduleRuntimeParameters property in the module.yml file.
Magic Parameter Injection
When a module function is called by the Kodexa bridge, parameters are automatically injected based on the function signature. You only need to declare the parameters you want — the bridge inspects your function signature and passes matching values automatically.Available Parameters
| Parameter | Type | Description |
|---|---|---|
document | Document | The Kodexa document being processed (inference only) |
document_family | DocumentFamily | The document family being processed, if available |
model_base | str | Path to the model’s base directory on disk |
pipeline_context | PipelineContext | The pipeline execution context |
model_store | ModelStore | The model store for persisting/loading model artifacts |
assistant | Assistant | The assistant associated with this execution |
assistant_id | str | The assistant ID |
project | Project | The project this execution belongs to |
execution_id | str | The current execution ID |
status_reporter | StatusReporter | Helper for posting live status updates to the UI |
event | dict | The triggering event (event handler only) |
Usage
Declare only the parameters your function needs:Inference Options
In addition to the magic parameters above, any inference options declared in yourmodule.yml are also injected by name. If you have an inference option called my_option then you will get a parameter called my_option passed to your inference function.
StatusReporter
Thestatus_reporter parameter provides fire-and-forget status updates that appear in the UI during execution. All calls are safe — errors are logged but never propagated.
| Argument | Required | Description |
|---|---|---|
title | Yes | Primary status message |
subtitle | No | Secondary detail text |
status_type | No | One of: thinking, searching, planning, reviewing, processing, analyzing, writing, waiting |
Pipeline Context Status Handler
For step-level progress tracking (progress bars in the UI), use thepipeline_context.status_handler callback:
