Skip to main content

Module executor

Module executor 

Source
Expand description

Standard LLM-based agent execution engine

Provides specialized execution for LLM-based agents with:

  • LLM chat completion with tool calling
  • Tool execution loop with iteration limits
  • Session management
  • Message history tracking

§Architecture

This module uses composition over inheritance:

  • Composes BaseAgent for MoFAAgent functionality
  • Adds LLM-specific functionality on top
+-------------------------------------------------------------+
|                     AgentExecutor                            |
+-------------------------------------------------------------+
|           BaseAgent (MoFAAgent implementation)               |
|   - id, name, capabilities, state                            |
|   - initialize, execute, shutdown                            |
+-------------------------------------------------------------+
|  + llm: Arc<dyn LLMProvider>                                |
|  + context: Arc<RwLock<PromptContext>>                       |
|  + tools: Arc<RwLock<SimpleToolRegistry>>                     |
|  + sessions: Arc<SessionManager>                              |
|  + config: AgentExecutorConfig                                |
+-------------------------------------------------------------+

Structs§

AgentExecutor
Standard LLM-based agent executor
AgentExecutorConfig
Agent execution configuration