Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mofa-foundation

The business layer providing concrete implementations and integrations.

Purpose

mofa-foundation provides:

  • LLM integration (OpenAI, Anthropic)
  • Agent patterns (ReAct, Secretary)
  • Persistence layer
  • Workflow orchestration
  • Collaboration protocols

Key Modules

ModuleDescription
llmLLM client and providers
reactReAct agent pattern
secretarySecretary agent pattern
persistenceStorage backends
workflowWorkflow orchestration
coordinationMulti-agent coordination

Usage

#![allow(unused)]
fn main() {
use mofa_foundation::llm::{LLMClient, openai_from_env};

let client = LLMClient::new(Arc::new(openai_from_env()?));
let response = client.ask("Hello").await?;
}

Feature Flags

FlagDescription
openaiOpenAI provider
anthropicAnthropic provider
persistencePersistence layer

Architecture Rules

  • ✅ Import traits from kernel
  • ✅ Provide implementations
  • ❌ NEVER re-define kernel traits

See Also