Core Concepts
Core Concepts¶
The MindFlight AI Server is built on a few fundamental concepts. Understanding these concepts will help you navigate the system easily and build reliable AI workflows.
Workflow Orchestration¶
Think of a workflow as a recipe. It contains a list of steps that must be followed in order, like:
- Preheat the oven.
- Mix ingredients.
- Bake for 30 minutes.
In MindFlight, each step might involve different tasks, some simple (saving data), some complex (asking an AI to generate content). The server ensures that every step runs in the right order and at the right time.
Metaphor:
A workflow is like a relay race: the baton (task) is passed smoothly from one runner (step) to the next until the finish line.
Providers¶
Providers are like plug-in tools. They handle specific tasks that the server itself doesn't know how to do directly. For example, if you need to send an email or fetch data from a Notion database, the server delegates these jobs to Providers.
Each Provider implements a contract:
- What services it offers (e.g., "send email", "list files"). - What input it needs. - What output it produces.
Metaphor:
Imagine the server as a busy chef in a large kitchen. The chef delegates chopping, baking, and cleaning to specialized assistants (Providers). The chef just focuses on giving orders and assembling the final dish.
Clients¶
Clients are the users of the system. They can be applications, dashboards, bots, or even simple scripts. Clients send requests to the server and wait for results or notifications.
Example of Clients: - A chatbot that asks the server to generate a LinkedIn post. - A dashboard that shows the status of running workflows.
Metaphor:
A Client is like a restaurant customer who places an order. The chef (server) prepares the meal and sends it back, sometimes with updates along the way (notifications).
Job Manager¶
The Job Manager is the background worker. Some tasks take time: sending a large number of emails, processing a big file, or syncing data. These tasks are sent to the Job Manager so they can be done asynchronously without blocking the rest of the system.
Metaphor:
Think of the Job Manager as a slow-cooking oven. While the chef (server) keeps working on other tasks, the oven does its job quietly in the background.
Notifications & Events¶
The Notification system allows the server to communicate what's happening:
- Internal notifications: The server tells its own components about important events (e.g., "an email was received").
- External notifications: The server tells Clients about events via webhooks (e.g., "your file is ready").
Metaphor:
This is like a paging system in a hospital: doctors (Clients) get notified when a patient (task) is ready.
Memory¶
Memory is a simple key-value store. It allows the server to remember small pieces of information between tasks or sessions. For instance, you might store a user's preferences or a temporary result.
Metaphor:
Think of it as sticky notes the chef uses to remember small but important things during a busy shift.
Resources¶
Resources are files or other large data objects that the server manages. These might be documents, images, or any files needed by the workflow.
Metaphor:
Resources are like ingredients stored in the pantry: the chef can pick them up when needed and put them back after use.