Plugins

Mistral Workflows plugins are standard Python packages that expose reusable workflows, activities, and dependencies under the mistralai.workflows.plugins namespace. Install them with pip and import into your code like any other package.

from mistralai.workflows.plugins.mistralai import mistralai_chat_complete
from mistralai.workflows.plugins.mistralai import Agent, Runner
Official Plugins

Official Plugins

Mistral AI Plugin

Mistral AI Plugin

Package: mistralai-workflows-plugins-mistralai

Provides native Mistral AI integration for LLM operations, agent execution, session management, and MCP support within workflows.

Key activities:

ActivityDescription
mistralai_chat_completeSingle-turn chat completion
mistralai_chat_streamStreaming chat completion
mistralai_chat_parseChat completion with structured output parsing
mistralai_embeddingsGenerate text embeddings
mistralai_ocrExtract text from images and documents
mistralai_create_agentCreate a remote agent
mistralai_update_agentUpdate a remote agent
mistralai_start_conversationStart an agent conversation
mistralai_start_conversation_streamStart an agent conversation with streaming
mistralai_append_conversationAdd messages to an existing conversation
mistralai_append_conversation_streamAdd messages to an existing conversation with streaming

Key components:

ComponentDescription
AgentAgent definition with model, tools, and configuration
RunnerOrchestrates agent execution with conversation and tool loops
LocalSessionLocal in-process agent session
RemoteSessionRemote stateful agent session
MCPStdioConfigConfiguration for local MCP servers (stdio)
MCPSSEConfigConfiguration for remote MCP servers (SSE)
MCPConfigUnion type alias for MCPStdioConfig | MCPSSEConfig
collect_mcp_toolsActivity: collect tool definitions from one or more MCP servers
execute_mcp_toolActivity: execute a named tool on its MCP server
get_mistral_clientDependency: returns a configured mistralai.Mistral client with workflow-aware auth, telemetry, and observability metadata

Example — chat completion:

import mistralai.workflows as workflows
from mistralai.workflows import workflow
from mistralai.workflows.plugins.mistralai import (
    ChatCompletionRequest,
    UserMessage,
    mistralai_chat_complete,
)
from pydantic import BaseModel


class Input(BaseModel):
    text: str


@workflow.define(name="summarize")
class SummarizeWorkflow:
    @workflow.entrypoint
    async def run(self, params: Input) -> str:
        request = ChatCompletionRequest(
            model="mistral-large-latest",
            messages=[UserMessage(content=f"Summarize this text:\n\n{params.text}")],
        )
        result = await mistralai_chat_complete(request)
        return result.choices[0].message.content

For full documentation on Agent, Runner, sessions, MCP, and multi-agent handoffs, see the Durable Agents guide.

Evaluation Plugin

Evaluation Plugin

Package: mistralai-workflows-plugins-evaluations

Runs offline evaluations inside a workflow. Each record runs in its own child workflow, with the task and scorers as parallel activities, and results upload to Studio.

Key components:

ComponentDescription
evaluation.runRun an evaluation over a dataset
evaluation.rescoreScore a persisted run again without re-running the task
evaluation.optimizeSearch for better prompts and parameters
evaluation.task / evaluation.scorerDecorators that turn a task and its scorers into activities

For the full guide, see Workflow evaluation plugin.

Installation

Installation

Install the plugins you need alongside the main SDK:

pip install mistralai-workflows
pip install mistralai-workflows-plugins-mistralai
pip install mistralai-workflows-plugins-evaluations
Creating Your Own Reusable Libraries

Creating Your Own Reusable Libraries

You can create custom packages to share reusable workflows, activities, and dependencies within your organization.

Note

The mistralai.workflows.plugins namespace is reserved for Mistral-supported plugins. For your own reusable code, use your own top-level package name.

Directory structure:

acme-workflows/
├── pyproject.toml
├── acme_workflows/
│   ├── __init__.py
│   ├── activities.py
│   └── workflows.py
└── tests/

pyproject.toml:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "acme-workflows"
version = "0.1.0"
dependencies = [
    "mistralai-workflows>=2.0.0",
]

After installing your package, import directly:

from acme_workflows.activities import my_custom_activity
from acme_workflows.workflows import my_rag_pipeline