Prerequisites
Before installing MoFA, ensure you have the following:Rust toolchain
Rust 1.85 or newer (edition 2024)
Git
For cloning the repository
LLM API key
OpenAI, Anthropic, or other provider
Build tools
C compiler and linker (platform-specific)
Install Rust
MoFA requires Rust 1.85 or newer. If you don’t have Rust installed:- Linux / macOS
- Windows
- macOS (Homebrew)
Verify installation
Get MoFA source
MoFA is currently distributed via source code:Note: A crates.io package (
mofa-sdk) is available, but we recommend using the latest source during active development.Build MoFA
Build the workspace
Build all crates in release mode for optimal performance:This compiles:
mofa-kernel- Microkernel coremofa-foundation- Business logic layermofa-runtime- Agent lifecycle managementmofa-plugins- Plugin systemmofa-sdk- Main SDKmofa-cli- Command-line tools
Run tests
Verify everything works:All tests should pass. If you see failures, check your Rust version and system configuration.
Platform-specific setup
- Linux
- macOS
- Windows
Configure LLM provider
MoFA supports multiple LLM providers. Choose one and set up credentials:- OpenAI
- Anthropic
- Ollama (Local)
- OpenRouter
Optional: Database setup
If you’re using persistence features, set up a database:- PostgreSQL
- MySQL
- SQLite
Install PostgreSQL (see platform-specific instructions above)Create a database:Configure Build with PostgreSQL feature:
.env:IDE setup
- VS Code
- RustRover / IntelliJ
- Neovim / Vim
Install recommended extensions:rust-analyzer will automatically detect
- rust-analyzer - Rust language server
- CodeLLDB - Debugger
- crates - Dependency management
Cargo.toml and provide IntelliSense.Verify installation
Run a simple example to confirm everything works:If you see this output, your installation is complete!
Troubleshooting
Error: could not find 'Cargo.toml'
Error: could not find 'Cargo.toml'
Make sure you’re in the
mofa directory:Error: linking with 'cc' failed
Error: linking with 'cc' failed
Install C compiler and build tools (see platform-specific setup above).Linux:
sudo apt install build-essentialmacOS: xcode-select --installWindows: Install Visual Studio Build ToolsError: OpenSSL not found
Error: OpenSSL not found
Install OpenSSL development libraries:
Error: OPENAI_API_KEY not found
Error: OPENAI_API_KEY not found
Set your API key:Or create a
.env file:Rust version too old
Rust version too old
Update Rust to 1.85 or newer:
Feature flags reference
MoFA uses Cargo features for optional functionality:| Feature | Description |
|---|---|
default | Core functionality only |
dora | Enable Dora-rs distributed runtime |
persistence-postgres | PostgreSQL database backend |
persistence-mysql | MySQL database backend |
persistence-sqlite | SQLite database backend |
monitoring | Built-in monitoring dashboard |
uniffi | Multi-language bindings (Python, Java, Swift, Kotlin, Go) |
openai | OpenAI provider (enabled by default) |
kokoro | Kokoro TTS engine |
Cargo.toml:
Next steps
Quick start
Build your first agent in under 10 minutes
Architecture
Learn about MoFA’s microkernel design
Examples
Explore 27+ working examples
API docs
Browse the Rust API reference