mloda-plugins
Guide an AI agent through building mloda (https://github.com/mloda-ai/mloda) plugins: FeatureGroup, ComputeFramework, and Extender classes. Use to check the mloda-registry index for an existing plugin
Files1
View on GitHubSKILL.mdskills/mloda-plugins/SKILL.md
GitHubmloda-plugins: Building mloda Plugins
Check the registry index first
Always do this before writing a plugin: it may already exist. mloda-registry publishes community plugins
covering common {col}__{op} transforms (aggregation, window/scalar/frame aggregate, scalar/point arithmetic,
rank, offset, percentile, binning, datetime, string ops, time bucketization, ffill, ema, sessionization,
resample); see its plugins table for the full list. None
of it ships with plain pip install mloda; install what you need (pip install mloda-community for all, or
one package like pip install "mloda-community-rank[pandas]"), then confirm what's actually loaded:
from mloda.user import PluginLoader
from mloda.steward import get_feature_group_docs
PluginLoader.all()
for fg in get_feature_group_docs():
print(fg.name, fg.description)
An empty or unrelated result means it isn't installed yet, not that it doesn't exist; see
02-discover-plugins.md
for more on installed-vs-available. (The mloda skill covers the same check for requesting data instead of
writing a plugin.)
The three plugin types
| Type | Role | Full guide |
|---|---|---|
| FeatureGroup | A data transformation, the unit you'll write most often | 09-create-feature-group.md |
| ComputeFramework | The execution backend a transformation runs on (Pandas, PyArrow, Polars, DuckDB, ...) | 10-create-compute-framework.md |
| Extender | Hooks for logging, tracing, validation around feature calculation | 11-create-extender.md |
Reach for a ComputeFramework only when adding a new execution backend, or an Extender for cross-cutting hooks.
Minimal example
A primary-source FeatureGroup (no inputs):
from mloda.provider import FeatureGroup
class CustomerScoring(FeatureGroup):
@classmethod
def calculate_feature(cls, data, features):
return {"customer_score": 100}
A chained one, reusable via an input__operation feature name (see "FeatureGroup: key decisions" below):
from mloda.provider import FeatureChainParserMixin, FeatureGroup
class MyOp(FeatureChainParserMixin, FeatureGroup):
PREFIX_PATTERN = r".*__([\w]+)_my_op$"
PROPERTY_MAPPING = {...}
@classmethod
def calculate_feature(cls, data, features): ...
Register either via PluginLoader.all() (installed package) or a direct import; see
03-create-plugin-in-project.md.
The plugin journey
Progression from using to sharing, each guide hosted in mloda-registry:
- Use an existing plugin / Discover plugins - start here, before writing anything.
- Create a plugin in your project - add a FeatureGroup inline, no separate package.
- Create a plugin package - scaffold a standalone installable package from mloda-plugin-template.
- Share with your team (private git) / Publish to the community registry / Contribute to official plugins / Become an official plugin.
Full progression: docs/guides/index.md.
FeatureGroup: key decisions
Full decision tree: guide 09. The recurring ones:
- Loads external data (file, DB, API)? Root feature pattern, see 01-root-features.md.
- Transforms 1+ existing features? Derived feature, see 02-derived-features.md.
- Should it be reusable via an
input__operationnaming pattern?FeatureChainParserMixin, see 03-chained-features.md (2+ inputs: 04-multi-input-features.md). - Multiple output columns? 05-multi-output-features.md (
feature~0,feature~1). - Fitted/trained state between runs? 06-artifact-features.md.
- Time ordering, group-by, or joins across feature groups? 07-index-features.md / 08-links-joins.md.
- Group-identity option vs. runtime-only metadata? 11-options.md - a required context option that isn't forwarded through
input_features()breaks chained requests; see 26-input-feature-forwarding.md for the forwarding mechanism itself. - Standard column transform (binning, window/scalar/frame aggregate, scalar/point arithmetic, rank, offset, percentile, string op, time bucketization, ffill, ema, resample, sessionization)? See the data operation patterns index before writing one from scratch.
- Feature defined via JSON/config instead of a naming pattern (e.g. to back the
mlodaskill's LLM Tool Function pattern)? 22-feature-config.md. - Ready to test? 10-testing-guide.md.
Full pattern index (27 guides, covering filters, validators, versioning, streaming, realtime execution, and more): feature-group-patterns/index.md.
ComputeFramework: key decisions
Full decision tree: guide 10.
- Needs a connection/session object? Data lake table format (Iceberg, Delta, Hudi) -> 05-data-lake.md; otherwise -> 03-stateful-connection.md (DuckDB, Spark).
- Lazy evaluation? 02-stateless-lazy.md (Polars Lazy, Ibis).
- Eager, no external deps? 04-zero-dependency.md; with deps -> 01-stateless-eager.md (Pandas, PyArrow).
- Cross-framework conversion? 08-framework-transformer.md.
- Joins/merges or filters? 06-merge-engine.md / 07-filter-engine.md.
- Ready to test? 09-testing-guide.md.
Full pattern index: compute-framework-patterns/index.md.
Extender: key decisions
Full guide: guide 11. Wraps feature calculation or input/output
validation; set a custom priority (lower runs first, default 100) if execution order matters; use class-level
storage for state under ParallelizationMode.MULTIPROCESSING (must be pickle-safe).
Reference
- Registry (community/enterprise plugins, guides): https://github.com/mloda-ai/mloda-registry
- Plugin template (scaffold for a standalone package): https://github.com/mloda-ai/mloda-plugin-template
- Core docs: https://mloda-ai.github.io/mloda/