mofa
Library Listed
MoFA - Modular Framework for Agents. Modular, Compositional and Programmable.
- Downloads
- 613
- Dependents
- 0
- Stars
- 296
- Forks
- 173
- Contributors
- 72
- Commits
- 2,438
- Latest release
- 0.1.1 ·
About
MoFA Agent Framework

Website | Quick Start | GitHub | Hackathon | Community
📋 Table of Contents
- Overview
- Why MoFA?
- Core Architecture
- Core Features
- Quick Start
- Roadmap
- Ecosystem & Related Repos
- Documentation
- Security
- Contributing
- Community
- License
Overview
MoFA (Modular Framework for Agents) is not just another entry in the crowded agent framework landscape. It is the first production-grade framework to achieve "write once, run everywhere" across languages, built for extreme performance, boundless extensibility, and runtime programmability. Through its revolutionary microkernel architecture and innovative dual-layer plugin system (compile-time + runtime), MoFA strikes the elusive balance between raw performance and dynamic flexibility.
What Sets MoFA Apart:
✅ Rust Core + UniFFI: Blazing performance with native multi-language interoperability
✅ Dual-Layer Plugins: Zero-cost compile-time extensions meet hot-swappable runtime scripts
✅ Microkernel Architecture: Clean separation of concerns, effortless to extend
✅ Cloud-Native by Design: First-class support for distributed and edge deployments
Read the full README
Why MoFA?
Performance
- Zero-cost abstractions in Rust
- Memory safety without garbage collection
- Orders of magnitude faster than Python-based frameworks
Polyglot by Design
- Auto-generated bindings for Python, Java, Go, Kotlin, Swift via UniFFI
- Call Rust core logic natively from any supported language
- Near-zero overhead compared to traditional FFI
Runtime Programmability
- Embedded Rhai scripting engine
- Hot-reload business logic without recompilation
- Runtime configuration and rule adjustments
- User-defined extensions on the fly
Dual-Layer Plugin Architecture
- Compile-time plugins: Extreme performance, native integration
- Runtime plugins: Dynamic loading, instant effect
- Support plugin hot loading and version management
Distributed by Nature
- Built on Dora-rs for distributed dataflow
- Seamless cross-process, cross-machine agent communication
- Edge computing ready
Actor-Model Concurrency
- Isolated agent processes via Ractor
- Message-passing architecture
- Battle-tested for high-concurrency workloads
Core Architecture
Microkernel + Dual-Layer Plugin System
MoFA adopts a layered microkernel architecture, achieving extreme extensibility through a dual-layer plugin system:
block-beta
columns 1
block:business["🧩 Business Layer"]
A["User-defined Agents, Workflows, Rules"]
end
space
block:runtime["⚡ Runtime Plugin Layer (Rhai Scripts)"]
B["Dynamic tool registration"]
C["Rule engine & Scripts"]
D["Hot-load logic"]
end
space
block:compile["🔧 Compile-time Plugin Layer (Rust/WASM)"]
E["LLM plugins"]
F["Tool plugins"]
G["Storage & Protocol"]
end
space
block:kernel["🏗️ Microkernel (mofa-kernel)"]
H["Lifecycle management"]
I["Metadata & Communication"]
J["Task scheduling"]
end
business --> runtime
runtime --> compile
compile --> kernel
Advantages of Dual-Layer Plugin System
Compile-time Plugins (Rust/WASM)
- Extreme performance, zero runtime overhead
- Type safety, compile-time error checking
- Support complex system calls and native integration
- WASM sandbox provides secure isolation
Runtime Plugins (Rhai Scripts)
- No recompilation needed, instant effect
- Business logic hot updates
- User-defined extensions
- Secure sandbox execution with configurable resource limits
Combined Power
- Use Rust plugins for performance-critical paths (e.g., LLM inference, data processing)
- Use Rhai scripts for business logic (e.g., rule engines, workflow orchestration)
- Seamless interoperability between both, covering 99% of extension scenarios
Core Features
1. Microkernel Architecture
MoFA adopts a layered microkernel architecture with mofa-kernel at its core. All other features (including plugin system, LLM capabilities, multi-agent collaboration, etc.) are built as modular components on top of the microkernel.
Core Design Principles
- Core Simplicity: The microkernel contains only the most basic functions: agent lifecycle management, metadata system, and dynamic management
- High Extensibility: All advanced features are extended through modular components and plugins, keeping the kernel stable
- Loose Coupling: Components communicate through standardized interfaces, easy to replace and upgrade
Integration with Plugin System
- The plugin system is developed based on the
Plugininterface of the microkernel. All plugins (including LLM plugins, tool plugins, etc.) are integrated through theAgentPluginstandard interface - The microkernel provides plugin registration center and lifecycle management, supporting plugin hot loading and version control
- LLM capabilities are implemented through
LLMPlugin, encapsulating LLM providers as plugins compliant with microkernel specifications
Integration with LLM
- LLM exists as a plugin component of the microkernel, providing standard LLM access capabilities through the
LLMCapabilityinterface - All agent collaboration patterns (chain, parallel, debate, etc.) are built on the microkernel's workflow engine and interact with LLMs through standardized LLM plugin interfaces
- Secretary mode is also implemented based on the microkernel's A2A communication protocol and task scheduling system
2. Dual-Layer Plugins
- Compile-time plugins: Extreme performance, native integration
- Runtime plugins: Dynamic loading, instant effect
- Seamless collaboration between both, covering all scenarios
3. Agent Coordination
- Priority Scheduling: Task scheduling system based on priority levels
- Communication Bus: Built-in inter-agent communication bus
- Workflow Engine: Visual workflow builder and executor
4. LLM and AI Capabilities
- LLM Abstraction Layer: Standardized LLM integration interface
- OpenAI Support: Built-in OpenAI API integration
- ReAct Pattern: Agent framework based on reasoning and action
- Multi-Agent Collaboration: LLM-driven agent coordination, supporting multiple collaboration modes:
- Request-Response: One-to-one deterministic tasks with synchronous replies
- Publish-Subscribe: One-to-many broadcast tasks with multiple receivers
- Consensus: Multi-round negotiation and voting for decision-making
- Debate: Agents alternate speaking to iteratively refine results
- Parallel: Simultaneous execution with automatic result aggregation
- Sequential: Pipeline execution where output flows to the next agent
- Custom: User-defined modes interpreted by the LLM
- Secretary Mode: Provides end-to-end task closed-loop management, including 5 core phases: receive ideas → record todos, clarify requirements → convert to project documents, schedule dispatch → call execution agents, monitor feedback → push key decisions to humans, acceptance report → update todos
Features:- 🧠 Autonomous task planning and decomposition
- 🔄 Intelligent agent scheduling and orchestration
- 👤 Human intervention at key nodes
- 📊 Full process observability and traceability
- 🔁 Closed-loop feedback and continuous optimization
5. Gateway & Distributed Control Plane
- HTTP Proxy: Server-side proxy for mofa-local-llm with OpenAI-compatible API
- Health Checking: Automatic backend health monitoring and circuit breakers
- Load Balancing: Round-robin, least-connections, weighted, and random algorithms
- Rate Limiting: Token bucket and sliding window strategies
- Distributed Consensus: Raft-based consensus for cluster coordination
- Observability: Prometheus metrics, OpenTelemetry tracing, structured logging
6. Persistence Layer
- Multiple Backends: Support PostgreSQL, MySQL, and SQLite
- Session Management: Persistent agent session storage
- Memory System: Stateful agent memory management
6. Monitoring & Observability
- Dashboard: Built-in web dashboard with real-time metrics
- Metrics System: Prometheus-compatible metrics system
- Tracing Framework: Distributed tracing system
7. Rhai Script Engine
MoFA integrates the Rhai embedded scripting language, providing runtime programmability without recompilation.
Script Engine Core
- Safe Sandbox Execution: Configurable operation limits, call stack depth, loop control
- Script Compilation Cache: Pre-compile scripts for improved repeated execution performance
- Rich Built-in Functions: String manipulation, math functions, JSON processing, time utilities
- Bidirectional JSON Conversion: Seamless conversion between JSON and Rhai Dynamic types
Scripted Workflow Nodes
- Script Task Nodes: Execute business logic via scripts
- Script Condition Nodes: Dynamic branch decisions
- Script Transform Nodes: Data format transformation
- YAML/JSON Workflow Loading: Define workflows through configuration files
Dynamic Tool System
- Script-based Tool Definition: Register tools at runtime
- Parameter Validation: Type checking, range validation, enum constraints
- Auto JSON Schema Generation: Compatible with LLM Function Calling
- Hot Loading: Dynamically load tools from directories
Rule Engine
- Priority Rules: Critical > High > Normal > Low
- Multiple Match Modes: First match, all match, ordered match
- Composite Actions: Set variables, trigger events, goto rules
- Rule Group Management: Support default fallback actions
Typical Application Scenarios
| Scenario | Description |
|---|---|
| Dynamic Business Rules | Discount strategies, content moderation rules, no redeployment needed |
| Configurable Workflows | User-defined data processing pipelines |
| LLM Tool Extensions | Register new tools at runtime for LLM calls |
| A/B Testing | Control experiment logic through scripts |
| Expression Evaluation | Dynamic condition checking, formula calculation |
Roadmap
Short-term Goals
- [ ] Dora-rs runtime support for distributed dataflow
- [ ] Complete distributed tracing implementation
- [ ] Python binding generation
- [ ] More LLM provider integrations
Long-term Goals
- [ ] Visual workflow designer UI
- [ ] Cloud-native deployment support
- [ ] Advanced agent coordination algorithms
- [ ] Agent platform
- [ ] Cross-process/cross-machine distributed agent collaboration
- [ ] Multi-agent collaboration standard protocol
- [ ] Cross-platform mobile support
- [ ] Evolve into agent operating system
Quick Start
Installation
Add MoFA to your Cargo.toml:
[dependencies]
mofa-sdk = "0.1.0"
See Quick Start for the full guide!
The runtime mode is most suitable for scenarios that require building complete agent workflows, specifically including:
- Multi-agent collaboration scenarios
The runtime provides a message bus (SimpleMessageBus/DoraChannel) and agent registration system, supporting communication between agents:
- Point-to-point communication (send_to_agent)
- Broadcast messages (broadcast)
- Topic pub/sub (publish_to_topic/subscribe_topic)
- Role management (get_agents_by_role)
When you need multiple agents to collaborate on complex tasks (such as master-slave architecture, division of labor), the runtime's communication mechanism can significantly simplify development.
- Event-driven agent applications
The runtime has a built-in event loop (run_with_receiver/run_event_loop) and interrupt handling system, automatically managing:
- Event reception and dispatch
- Agent state lifecycle
- Timeout and interrupt handling
Suitable for building applications that need to respond to external events or timers (such as real-time dialogue systems, event response robots).
- Distributed agent systems
When the dora feature is enabled, the runtime provides Dora adapters (DoraAgentNode/DoraDataflow), supporting:
- Distributed node deployment
- Cross-node agent communication
- Data flow management
Suitable for production scenarios requiring large-scale deployment and low-latency communication.
- Structured agent building
The runtime provides AgentBuilder fluent API, simplifying agent:
- Configuration management
- Plugin integration
- Capability declaration
- Port configuration
Suitable for scenarios where you need to quickly build standardized agents, especially when you need to uniformly manage multiple agent configurations.
- Production-grade applications
The runtime provides comprehensive:
- Health checks and state management
- Logging and monitoring integration
- Error handling mechanisms
Suitable for building production applications that need stable operation, rather than simple plugin testing or prototype development.
CLI Production Smoke Example
To verify CLI production readiness from a user perspective, MoFA includes a black-box smoke example:
- Path:
examples/cli_production_smoke - Runner: invokes the built
mofabinary in isolatedXDG_*directories - Validation: exit codes + stable output tokens (no brittle full snapshots)
Coverage in this smoke run:
- Top-level commands:
info,config path,config list - Agent commands:
start,status,list,restart,stop - Session commands:
list,show,export,delete - Plugin commands:
list,info,uninstall - Tool commands:
list,info
Run it:
# repo root
cargo build -p mofa-cli
# examples workspace
cd examples
cargo run -p cli_production_smoke
cargo test -p cli_production_smoke
Optional binary override:
export MOFA_BIN=/absolute/path/to/mofa
Limitations:
- This smoke flow is manually run (not CI-gated in this PR).
- Assertions focus on behavior and persistence effects, not exact formatting.
Documentation
- API Documentation
- Security Guide - Comprehensive security documentation
- GitHub Repository
- Examples
Security
MoFA is designed with security-first principles. Key security features include:
- WASM Sandboxing: Strong isolation for compile-time plugins
- Rhai Script Limits: Configurable resource limits for runtime scripts (memory, CPU, operations)
- Type Safety: Rust's memory safety and type system prevent entire classes of vulnerabilities
- Credential Management: Environment variable support for secure credential handling
- Plugin Verification: Version tracking and integrity checks for plugins
For comprehensive security documentation, including:
- Credential management best practices
- Runtime scripting security configuration
- Plugin security guidelines
- Production deployment security checklist
- Threat model and attack surface analysis
Please see our Security Guide and Security Policy.
Reporting Vulnerabilities: If you discover a security vulnerability, please report it privately through our Security Policy.
Contributing
We welcome contributions! Please check out our contributing guide for more details.
We ❤️ first-time contributors! Check out our good-first-issue labels to get started.
🌐 Ecosystem & Related Repos
| Repository | Description | Status |
|---|---|---|
| mofa-studio | GPU-accelerated desktop voice-chat & model management app (Makepad) | 🚧 Prototype |
| GSoC | Google Summer of Code 2026 ideas & proposal guide | ✅ Active |
| mofa-input | High-performance local AI voice input | ✅ Active |
| mofa-local-llm | Local LLM inference with OpenAI-compatible API (integrates with mofa-gateway) | ✅ Active |
| makepad-chart | GPU-accelerated chart widgets for Makepad | ✅ Active |
| makepad-flow | Flow chart widget for visual workflow editing | ✅ Active |
| makepad-d3 | D3-style data visualization for Makepad | ✅ Active |
| dora | Distributed dataflow middleware (fork of dora-rs) | ✅ Active |
🎓 GSoC 2026
MoFA is participating in Google Summer of Code 2026 as a first-time organization! We have 6 exciting project ideas covering plugin systems, observability dashboards, edge orchestrators, time-travel debuggers, and more.
👉 Check out our GSoC Ideas List
Community
- GitHub Discussions: https://github.com/mofa-org/mofa/discussions
- Discord: https://discord.com/invite/hKJZzDMMm9
Star History
🙏 Acknowledgments
MoFA stands on the shoulders of giants:
- Rust - Perfect combination of performance and safety
- UniFFI - Mozilla's multi-language binding magic
- Rhai - Powerful embedded scripting engine
- Tokio - Async runtime cornerstone
- Ractor - Actor model concurrency framework
- Dora - Distributed dataflow runtime
- Wasmtime - WebAssembly runtime
Support
源起之道支持|Supported by Upstream Labs
License
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- Optional
- Binds native code: ort-sys (feature kokoro), pnet_sys (feature dora)
- Python bindings
- No Python binding crate found
- License
- Apache-2.0
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
MoFA - Modular Framework for Agents. Modular, Compositional and Programmable. |
613 downloads over 30 days | 0 | 296 | 0.1.1 | GPU support unknown | Binds native code: ort-sys (feature kokoro), pnet_sys (feature dora) | Apache-2.0 |
|
rust-mcp-sdk Featured
An asynchronous SDK and framework for building MCP-Servers and MCP-Clients, leveraging the rust-mcp-schema for type safe MCP Schema Objects. |
29,764 downloads over 30 days | 51 | 199 | 2.0.0 | GPU support unknown | No native code found | MIT |
|
autoagents Listed
Agent Framework for Building Autonomous Agents |
8,627 downloads over 30 days | 4 | 779 | 0.4.0 | CUDA, WebGPU, Metal, ROCm, Vulkan | Binds native code: llama-cpp-sys-2, ort-sys, alsa-sys (feature audio-capture), intel-mkl-src (feature full), rquickjs-sys (feature codeact) | Apache-2.0 OR MIT |
|
adk-rust Listed
Rust Agent Development Kit - Build AI agents in Rust with modular components for models, tools, memory, and more. |
5,419 downloads over 30 days | 25 | 743 | 2.3.0 | CUDA, Metal | Binds native code: alsa-sys (feature desktop-audio), audiopus_sys (feature openai-webrtc), cxx (feature livekit), espeak-rs-sys (feature kokoro), libsqlite3-sys (feature sqlite) and 4 more | Apache-2.0 |
|
chidori Listed
The agent framework where every run is durable, replayable, and resumable by default. Plain async TypeScript agents on an embedded pure-Rust JS engine. Python bindings |
257 downloads over 30 days | 0 | 1,372 | 3.8.1 | GPU support unknown | Binds native code: aws-lc-rs, aws-lc-sys, lcms2-sys, libffi-sys, libsqlite3-sys and 4 more | Apache-2.0 |
|
Think before doing, prove before saving. Vestige is the local-first cognitive operating system and deterministic safety kernel for autonomous AI agents. |
41 binary downloads per release | Not applicable | 660 | Not measured | Not measured | AGPL-3.0 | |
|
An open protocol that gives AI agents a secure, sandboxed place to run code and use tools — with lean context usage. AXP works alongside MCP |
Not measured | Not applicable | 3 | Not measured | Not measured | Not measured | Apache-2.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 296 stars, 173 forks and 72 contributors. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 5 Jul 2026, 127 days ago. The rules expect an update within 365 days. Dormancy rule
- The latest release requires the deprecated dependency bincode. RUSTSEC-2025-0141 Rot signals rule
Check notes
- the latest release was packaged from a dirty working tree
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.1.1 base 300, capped at 2 releases = 100, raised to the 365-day floor: E = 365 daysdormancy: last activity 2026-07-05, 127 days ago, E = 365: activerot: deprecated requirement `bincode (RUSTSEC-2025-0141, https://rustsec.org/advisories/RUSTSEC-2025-0141.html)`featured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 296 (needs 4539), forks 173 (needs 434), contributors 72 (needs 79)listed: listed: no archive, new or featured rule applies
Crates8 crates
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the GitHub repository description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 4 months ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-07-05 | GitHub repository | Yes | |
| Latest release | 2026-02-21 | crates.io database dump | Yes | |
| First release | 2026-02-20 | crates.io database dump | Yes | |
| Latest version | 0.1.1 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 230 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 2 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | bincode (RUSTSEC-2025-0141, https://rustsec.org/advisories/RUSTSEC-2025-0141.html) | crates.io database dump | Yes |
Distribution2 releases, 613 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 2 | crates.io database dump | Yes | |
| Downloads over 30 days | 613 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository296 stars, 173 forks, 72 contributors, 2,438 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 296 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 173 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 72 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 2438 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | Binds native code: ort-sys (feature kokoro), pnet_sys (feature dora) | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.