Skip to content
项目

关于

mloda.ai - Open Data Access for AI and ML. Plugin-based. Traceable. Framework-agnostic.

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+2
1个月
+3

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

mloda

Empower AI agents to access the data they actually need.

mloda is an open-source, deterministic data layer between your AI agents and your data sources. Instead of writing SQL and glue code on the fly, your agent asks for what it needs, and mloda reads and transforms the data with logic your team verified once. Every run is traceable and auditable, and everything runs on your own infrastructure.

PyPI PyPI Downloads Python versions CI License: Apache-2.0 Tests: 27,000+

Website · Docs · LinkedIn · Agent Skills · Plugin registry

Comic. On a ward round, a doctor asks: should I change my patient's insulin? Without mloda, the AI says increase it by 2 units, cannot say why, and there is no data trace. With mloda, the AI says glucose averaged 147.5, above target, and shows its data trace: readings 110, 150, missing, 180, the gap filled from 12:00, computed by the verified calculation glucose__ffill_imputed__avg_aggr. The doctor is happy: verified once, for every patient, so she only checks the result and its trace. Write it once. Verify it once. Reuse it for every patient.


Get started

pip install mloda   # Install with pip
uvx mloda demo      # Or try the demo with uv

Or let your coding agent set it up with this prompt:

Add the Python library mloda to this project with its package manager. Install the mloda
Agent Skills from https://github.com/mloda-ai/mloda-skills. Run `mloda demo`, explain the
output, then show me how to request one of my own columns by name.

Connect your AI assistant via MCP

pip install "mloda[mcp]"           # Install the MCP extra
claude mcp add mloda -- mloda-mcp  # Add the server to Claude Code

Or let your coding agent set it up with this prompt:

Set up the mloda MCP server by following https://mloda-ai.github.io/mloda/in_depth/mcp-server/.
Add mloda with its `mcp` extra to this project using the project's package manager, then register
`mloda-mcp` by its absolute path in my MCP client, for this project only. Ask me which client I use
if you can't tell, and ask before editing any config outside this project. Keep the default plan
mode; do not enable execute mode. Done when the client shows the server connected and the
`mloda_search_features` tool lists features; if that needs a restart, tell me what to check.

The MCP server starts in plan mode: your agent can find features and plan requests, but nothing runs until you set mode = "execute". To work with your own data, list your sources in mloda.toml and pass it with --config; see the MCP docs. If mloda-mcp is not on your PATH, use its full path in the command above.


How it works

Inside your infrastructure, databases, files, APIs and documents all connect to mloda, one access point whose FeatureGroups are verified once and which makes a plan for every run. Agents, reports and notebooks ask for income__sum_aggr and get 270,000 plus its data trace.
Many data sources, one access point: agents ask mloda for a feature and get the answer with its data trace.

Plugins

Everything in mloda is a plugin, and every plugin is one of three kinds:

A plugin is a FeatureGroup (a data source or an operation), a ComputeFramework (an engine to run on) or an Extender (adds behavior around steps, such as logging, audit or access gates).

📦 Reuse what exists: the built-in FeatureGroups and the community plugins.

🛠️ Create your own plugin: start from mloda-plugin-template.

Example

Ask for a feature by name

income__sum_aggr and age__avg_aggr are not in the data. mloda finds a FeatureGroup that can produce each name and runs it:

from mloda.user import PluginLoader, mloda
PluginLoader.all()

result = mloda.run_all(
    features=["customer_id", "income", "income__sum_aggr", "age__avg_aggr"],
    compute_frameworks=["PythonDictFramework"],
    api_data={"SampleData": {
        "customer_id": ["C001", "C002", "C003", "C004", "C005"],
        "age": [25, None, 45, 30, 50],
        "income": [50000, 75000, None, 60000, 85000],
    }},
)
print(result)
[{'customer_id': ['C001', 'C002', 'C003', 'C004', 'C005'], 'income': [50000, 75000, None, 60000, 85000]}, {'age__avg_aggr': [37.5, 37.5, 37.5, 37.5, 37.5], 'income__sum_aggr': [270000, 270000, 270000, 270000, 270000]}]

The aggregation FeatureGroup ships with mloda. It skips missing values, so the sum covers the four incomes that exist. If nothing can produce a name, mloda stops and says why instead of guessing.


When to use mloda

✅ Use mloda when ❌ Skip it when
• agents need data from several sources
• results must be traceable
• several agents or apps share the same logic
• one database with simple queries (use an ORM)
• a one-off script

Ecosystem


Contributing

mloda is open source under the Apache-2.0 license. Contributions are welcome, see CONTRIBUTING.md. If mloda helps you, ⭐ star the repository.

探索相关项目

加载中…