Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Microsoft Semantic kernel Agent Process Integration

From Leeroopedia
Knowledge Sources
Domains Process_Orchestration, AI_Agents
Last Updated 2026-02-11 19:00 GMT

Overview

Agent process integration enables AI agents to participate as first-class steps within event-driven process workflows, combining structured orchestration with intelligent, model-driven decision-making.

Description

Agent Process Integration is the principle that bridges Semantic Kernel's two primary orchestration paradigms: deterministic process workflows and AI-driven agent interactions. By allowing AI agents to be embedded as process steps, developers can create workflows where some steps follow fixed logic (data validation, API calls, format transformations) while others leverage AI models to make context-dependent decisions (content generation, intent classification, multi-turn conversation).

The integration works by wrapping an AgentDefinition as a process step through the AddStepFromAgent method on ProcessBuilder. The resulting step participates in the process's event routing like any other step: it receives events as input, performs its work (in this case, invoking the AI agent), and emits result events that can be routed to downstream steps.

This hybrid approach addresses several architectural needs:

  • Structured decision points: Deterministic steps handle validation, routing, and data transformation with predictable behavior, while agent steps handle tasks requiring reasoning, generation, or natural language understanding.
  • Conversation management: Agent steps can maintain conversation threads (via threadName) across multiple invocations within the same process execution, enabling multi-turn dialogue patterns.
  • Agent type flexibility: The integration supports different agent types including ChatCompletionAgent (for simple prompt-response patterns) and OpenAIAssistantAgent (for agents backed by the OpenAI Assistants API with tool use capabilities).
  • Error handling: Agent steps participate in the standard process error handling through OnFunctionError, allowing the process to gracefully handle AI service failures.
  • Human-in-the-loop: The HITLMode parameter enables human oversight of agent decisions within the process flow.

The agent step model preserves the process framework's core properties: steps are loosely coupled through events, the process graph is defined declaratively, and execution is managed by the process runtime.

Usage

Use agent process integration when your workflow requires steps that involve AI reasoning, natural language processing, or content generation alongside deterministic processing steps. Typical use cases include customer service workflows (agent handles conversation, deterministic steps handle account operations), content pipelines (agent generates or reviews content, deterministic steps handle publishing), and decision support systems (agent analyzes data, deterministic steps enforce business rules).

Theoretical Basis

Agent process integration implements a Hybrid Orchestration pattern that combines reactive process graphs with proactive AI agent behavior.

Actor Model Integration: Each agent step can be viewed as an actor within the process system. The agent maintains its own state (conversation history via threads), processes messages (incoming events), and produces responses (outgoing events):

AgentStep as Actor:
  State: conversation thread, agent configuration
  Receive(event): invoke AI model with event data as message
  Respond: emit result event with model response

Deterministic vs. Non-Deterministic Steps: The process graph contains two types of nodes:

Deterministic steps: f(input) → output  (same input always produces same output)
Agent steps:         g(input, model_state) → output  (output depends on model)

The process runtime treats both types identically from a routing perspective, but their behavioral characteristics differ. Deterministic steps are predictable and fast; agent steps are probabilistic and may involve external API calls. The process framework accommodates both by using asynchronous event dispatch.

Conversation Thread Lifecycle: Agent steps that maintain conversation threads create a stateful interaction pattern within the otherwise event-driven process:

Process Execution:
  Event1 → AgentStep(thread=T1) → Response1
  Event2 → AgentStep(thread=T1) → Response2  (continues same conversation)
  Event3 → AgentStep(thread=T1) → Response3  (cumulative context)

The KernelProcessThreadLifetime controls whether threads are scoped to a single process execution (Scoped) or persist across executions.

Delegation Pattern: Agent process integration enables a delegation pattern where a primary orchestrating agent can delegate subtasks to specialized agents through the process graph:

UserInput → ManagerAgent → (delegates) → SpecialistAgentGroup → Result → ManagerAgent → UserOutput

This is implemented by routing the manager agent's output events to specialist agent steps and routing their results back to the manager. The process graph provides the structural backbone for this multi-agent delegation.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment