How mofa-org/mofa works
MoFA is an enterprise agent framework and LLM infrastructure platform. Its principal workflow accepts user requests through an agent runtime, which uses models, tools, workflows or retrieval to produce results; the platform also documents per-call token metering, cost accounting and audit. Distinct supporting capabilities include programmable plugins, gateway access, monitoring, voice inference and polyglot bindings. The README describes credits, plans, billing and recharge as planned enterprise-track work, so those are not represented as implemented stages. Several links are documented capabilities rather than inspected call paths.
Main entry points: agent.rs Agent execution · cost Token metering · lib.rs Microkernel · server.rs API gateway
Components 17
Agent Runtime
- Agent execution
crates/mofa-foundation/src/llm/agent.rs - Workflows
crates/mofa-foundation/src/workflow - RAG pipeline
crates/mofa-kernel/src/rag/pipeline.rs - Voice inference
crates/mofa-foundation/src/orchestrator/pipeline.rs - Microkernel
crates/mofa-kernel/src/lib.rs
Extensions
- Rhai scripts
crates/mofa-extra/src/rhai/engine.rs - Plugin hot reload
crates/mofa-plugins/src/hot_reload/manager.rs - WASM plugins
crates/mofa-plugins/src/wasm_runtime/plugin.rs
LLM Infrastructure
- LLM providers
crates/mofa-foundation/src/llm/client.rs - Token metering
crates/mofa-foundation/src/cost - Usage storage
crates/mofa-foundation/src/persistence
Interfaces
- API gateway
crates/mofa-gateway/src/openai_compat/server.rs - Language bindings
crates/mofa-ffi/src/uniffi_bindings.rs - CLI and TUI
crates/mofa-cli/src/main.rs
Operations
- Monitoring dashboard
crates/mofa-monitoring/src/dashboard/server.rs - Credits and billing
Other components
- End user
Connections 16
- End user → Agent execution: sends request
README.md - Agent execution → LLM providers: calls models
crates/mofa-foundation/src/llm/agent.rs - Agent execution → Token metering: accounts tokens
README.md - Token metering → Usage storage: persists usage
README.md - Agent execution → Workflows: runs workflows
- Agent execution → RAG pipeline: uses retrieval
- Agent execution → Voice inference: supports voice
- Rhai scripts → Microkernel: extends runtime
README.md - Plugin hot reload → Microkernel: extends runtime
README.md - WASM plugins → Microkernel: extends runtime
README.md - End user → API gateway: sends API request
README.md - API gateway → Agent execution: routes requests
- CLI and TUI → Agent execution: runs agents
- Monitoring dashboard → Token metering: shows costs
README.md - Language bindings → Microkernel: exposes core
README.md - Token metering → Credits and billing: feeds planned billing
README.md