MoFA is a software framework for building AI agents through a composition-based approach.
Project description
MoFA 开发框架
官网 | 快速入门 | GitHub | 比赛 | 社区
核心特性
- 🚀 composable AI 架构:通过模块化 Agent 堆叠组合,快速构建复杂智能体系统,支持多模型、多工具协同工作。
- 🔄数据流驱动:采用直观的数据流(DataFlow)模式替代传统工作流(Workflow),实现 Agent 间灵活解耦与动态重组。
- 🐍全栈 Python 支持:从 Agent 开发到数据流配置均提供 Python 友好接口,同时兼容 Rust 高性能节点扩展。
- 🧩丰富的节点生态:内置终端交互、LLM 调用、工具集成等基础节点,支持自定义节点快速接入。
- 🔌多框架兼容:基于 Dora-rs runtime 构建,支持与 ROS2、OpenTelemetry 等系统无缝集成。
- 🖥️MoFA Stage 可视化工具:提供图形化界面,支持 Dataflow 和 Node 的可视化创建、管理与调试。
支持矩阵
| 特性 | 支持程度 |
|---|---|
| API 支持 | Python 3.10+ ✅ Rust 扩展 📐 |
| 操作系统 | Linux (Ubuntu 22.04) ✅ macOS (ARM/x86) ✅ WSL2 ✅ Windows ❌ |
| 通信方式 | 共享内存(本地)✅ TCP 网络(分布式)📐 |
| 消息格式 | JSON ✅ Apache Arrow 📐 |
| LLM 集成 | OpenAI 系列 ✅ Qwen 系列 ✅ 本地模型(llama.cpp)📐 |
| 配置方式 | YAML 数据流定义 ✅ Python 代码生成 📐 MoFA Stage 图形化配置 ✅ |
| 包管理 | pip(Python 节点)✅ cargo(Rust 节点)📐 |
- ✅ = 完全支持
- 📐 = 实验性支持(需贡献)
- ❌ = 暂不支持
快速开始指南
1. 开发环境配置
1.1 Python 环境
首先需构建隔离的 Python 运行环境:
# 创建虚拟环境
python3 -m venv .mofa
# 激活虚拟环境
source .mofa/bin/activate
环境要求
- Python 版本需为 3.10 或 3.11
- 兼容系统:WSL(Ubuntu 22.04)、macOS
- 暂不支持 Windows 系统
1.2 Rust 环境配置
# 安装 Rust 工具链
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 安装过程中保持默认配置(直接按 Enter 确认)
# 安装 Dora 命令行工具(MoFA 依赖的 runtime)
cargo install dora-cli
# 验证安装结果
rustc --version
cargo --version
dora --version
2. 安装 MoFA 框架
# 从 PyPI 安装(推荐)
pip install mofa-core
# 或从源码安装最新开发版
pip install git+https://github.com/mofa-org/mofa.git
# 验证安装
pip show mofa-core
mofa --help
3. 运行 Hello World 示例
# 克隆代码仓库
git clone git@github.com:mofa-org/mofa.git
3.1 启动数据流
cd mofa/dataflows/hello_world
mofa run hello_world_dataflow.yml
示例输出:
Send Your Task : 你好
-------------hello_world_result---------------
你好
设计理念
MoFA 是一个用于构建可组合 AI 智能体的软件框架。通过 MoFA,开发者可以通过模板创建智能体(Agent),并以堆叠方式组合形成更强大的超级智能体(Super Agent)。
核心设计哲学:
- 让普通人做非凡事:AI 不应是精英专属,MoFA 让每个人都能开发和应用 AI,将不可能变为可能。
- 组合式 AI:受 Unix 哲学启发,以"组合"为核心,像搭积木一样构建、连接智能体与工具,让 AI 简单、灵活且强大。
- 万物皆智能体:在 MoFA 生态中,智能体是 AI 时代的应用载体——不仅是大语言模型,还可以是代码、脚本、API 甚至 MoFA 本身。
- 数据流驱动:摒弃复杂工作流,采用更直观的数据流模式,使智能体可自由组合、拆解与复用。
技术架构图
MoFA Stage 可视化工具
MoFA Stage 是 MoFA 生态的图形化控制中心,支持在可视化界面中快速创建、管理和调试 Dataflow 与 Node:
核心功能
- node/dataflow 模板库:提供丰富的智能体模板,一键生成 node 项目。
- Dataflow 可视化创建:通过拖拽式界面定义数据流,直观配置节点间的消息传递关系。
- Node 管理:统一管理自定义节点与官方节点,支持快速接入新功能。
- 智能体生命周期管理:在图形化界面中启动、停止、监控智能体运行状态。
界面预览
Node Hub 界面
Dataflow界面
开发指南
6 分钟开发首个应用
参考6分钟开发指南,快速构建基于大语言模型的智能体,包含环境变量配置、项目初始化、逻辑实现、数据流定义全流程。
示例与文档
| 类型 | 名称 | 描述 | 最后更新 |
|---|---|---|---|
| 入门 | Hello World | 基础数据流交互示例 | |
| LLM | Qwen 智能体 | 调用 Qwen API 的对话智能体 | |
| 工具集成 | 天气查询 | 查询ip所在地天气的智能体 |
更多文档请参考 MoFA 官方文档。
贡献指南
我们欢迎所有开发者参与贡献,无论您的经验水平如何。请参考贡献指南了解如何参与项目开发。
社区交流
许可证
本项目采用 Apache-2.0 许可证,详情参见 LICENSE。
相关资源 📚
星标历史
======= History
0.1.10 (2025-10-28)
- Auto-release: fix: ubuntu dependency error
0.1.9 (2025-10-28)
- Auto-release: fix: packaging
0.1.8 (2025-10-28)
- Auto-release: fix: init
0.1.7 (2025-10-28)
- Auto-release: fix: run-agent
0.1.6 (2025-10-27)
- Auto-release: fix: rust install
0.1.5 (2025-10-27)
- Auto-release: update: readme.md
0.1.4 (2025-10-27)
- Auto-release: fix: dir error
0.1.3 (2025-10-27)
- Auto-release: Fix: mofa vibe
0.1.2 (2025-10-27)
- Auto-release: feat: major update on cli
0.1.1 (2025-10-27)
- Auto-release: Fix: HEREDOC
0.1.0 (2025-10-27)
- First release of mofa-core (renamed from mofa-ai)
- mofa vibe command - AI-powered agent generator with automatic testing and optimization
- mofa debug command - Unit testing and debugging for individual nodes with test case support
- mofa run command - Run dataflows in isolated virtual environments with automatic dependency management
- mofa new-agent command - Create new agents from templates
- Interactive input support for better user experience
- Optimized package installation with uv support
- Python 3.10, 3.11, and 3.12 support
- Full integration with dora-rs dataflow runtime
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mofa_core-0.1.10.tar.gz.
File metadata
- Download URL: mofa_core-0.1.10.tar.gz
- Upload date:
- Size: 91.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3dc376fdddab20a19871c6df4cebb7a2d360e05681349eef779a721592047dc
|
|
| MD5 |
899d4e2fdae23eea6b1d0a73e90084be
|
|
| BLAKE2b-256 |
687aee0de315f7a31c303516169f60c79d1fad8c16aa656edf9ed0818a5898d4
|
File details
Details for the file mofa_core-0.1.10-py3-none-any.whl.
File metadata
- Download URL: mofa_core-0.1.10-py3-none-any.whl
- Upload date:
- Size: 113.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94fed49397d0b9318fe098b4a866274bdc857ca40432f3c976a56c91a6b06194
|
|
| MD5 |
46015111d33c5a2b0906d3188c961213
|
|
| BLAKE2b-256 |
70b12015ccc4e5e45187e5de0a0bec3d38a044ecd1caca4d1a2fcdb76bfbc4bb
|