MAF Agent Pipeline

Agent middleware wraps the RawAgent and context providers, atop a swappable ChatClient pipeline

MAF Agent Pipeline Agent middleware wraps the RawAgent and context providers, atop a swappable ChatClient pipeline Agent layer ChatClient pipeline Caller · run(input) · Architecture component Caller run(input) Agent Middleware · pre / post hooks · Agent layer · wraps Agent Middleware pre / post hooks wraps RawAgent · core agent loop · Agent layer · core RawAgent core agent loop core Context Providers · memory injection · Agent layer Context Providers memory injection ChatClient · swappable pipeline · ChatClient pipeline · adapter ChatClient swappable pipeline adapter Model · LLM endpoint · Architecture component Model LLM endpoint invoke inject context chat request API call Legend External Backend Database Cloud

Agent Layer

  • • Middleware wraps every run with pre and post hooks
  • • The RawAgent holds the core agent loop
  • • Context providers inject memory before the model call

Client Layer

  • • The ChatClient is a separate, swappable pipeline
  • • It is the only component that talks to the model
  • • Swapping clients never touches agent logic

Why It Layers

  • • Agent concerns and transport concerns stay independent
  • • Middleware composes without editing the RawAgent
  • • The model endpoint is reachable only through the client