Introduction¶
The Client MindFlight AI component is a lightweight agent responsible for listening to external events (such as webhooks, cron jobs, user inputs, or triggers from other AI agents) and forwarding them to the MindFlight Orchestrator (MFO) server using a robust and configurable API client.
A client for the MFO server¶
mfo-client
is a Go library designed as a client for the MFO server, a platform focused on agentic workflows, task automation, and centralized interaction management. The client facilitates interaction with the server's REST API through a structured and extensible API client module.
This module features a BaseClient
for common HTTP operations, an AuthProvider
interface for flexible authentication mechanisms, and specialized client interfaces (e.g., for Chat, Resources, Events) for interacting with different MFO server functionalities.
The client also integrates a powerful local task workflow engine based on go-taskflow
. This allows developers to define complex, potentially multi-agent workflows using a declarative YAML format, execute them efficiently via the mfo-client
, and manage related server-side resources.
The API client is designed for resilience, incorporating configurable error handling, retry policies, and circuit breaker patterns to manage communication with the MFO server robustly.
The library design emphasizes flexibility and human readability, particularly through its use of YAML for taskflow definitions and client configuration. This aligns with preferences for systems where configurations are easily understood and modifiable.
While the client can execute complex local taskflows, it typically delegates extensive external interactions and persistence entirely to the MFO server, promoting a stateless client design where appropriate.
🏷️ What is it?¶
Think of this component as a smart and resilient receptionist in an office:
- It listens at the front desk, waiting for someone to arrive (an event).
- It takes down notes to capture all the relevant details and validates them.
- It immediately and reliably forwards the request to the internal team (the MFO server) using a secure and well-managed communication channel (the API client) for further action.
This separation of concerns allows the Client to remain lightweight yet robust in its primary role of event capture, local task orchestration, and reliable forwarding.
🔧 What does it do?¶
- Receives events: These can be webhooks, user actions, cron triggers, or AI-generated events.
- Parses and validates: Ensures incoming data is formatted and valid according to predefined schemas or rules.
- Executes local taskflows: Can run predefined workflows (defined in YAML) triggered by events, which may involve multiple steps, conditional logic, and calls to the MFO server.
- Forwards events/data: Pushes validated events or results of taskflows to the MFO server via its structured, authenticated, and resilient API client (handling retries and errors as configured).
🗺️ Where does it fit?¶
The Client is one of three core components of the MindFlight AI architecture:
- Client: Receives external events and forwards them.
- Server (MFO): Central hub that orchestrates workflows and executes tasks.
- Providers: External services and tools (APIs, databases, etc.).
You can deploy multiple Client instances for different environments or applications. For example: - One client to handle CRM events. - Another to manage Helpdesk integrations. - Yet another dedicated to IoT devices.
🖼️ High-Level Architecture¶
graph TD
A[External Systems] --> B(Client)
B --> C(MFO Server)
C --> D(Providers)
click B href "./client_mindflight_ai_doc.md" "Client Documentation"
click C href "./server_mindflight_ai_doc.md" "Server Documentation"
click D href "./providers_mindflight_ai_doc.md" "Providers Documentation"
📦 Why multiple Clients?¶
Having multiple Client instances provides:
- Scalability: Each Client can be tailored for specific services or workloads.
- Fault isolation: One misbehaving Client won't impact others.
- Deployment flexibility: Place Clients closer to your data sources to minimize latency.