⚠ Deprecated: Legacy
Suggested alternative: LevelUp.Strategos
Microsoft Agent Framework integration for Agentic.Workflow. Provides abstractions for LLM-powered workflow steps with conversation continuity, streaming responses, and agent selection.
$ dotnet add package Agentic.Workflow.AgentsMicrosoft Agent Framework integration for Agentic.Workflow. Provides abstractions for LLM-powered workflow steps with conversation continuity and streaming responses.
dotnet add package Agentic.Workflow.Agents
Create workflow steps powered by LLM agents:
public class AnalyzeDocumentStep : IAgentStep<DocumentState>
{
public string GetSystemPrompt() => """
You are a document analyst. Analyze the provided document and extract key insights.
Focus on: main topics, sentiment, key entities, and actionable recommendations.
""";
public Type? GetOutputSchemaType() => typeof(DocumentAnalysis);
public async Task<StepResult<DocumentState>> ExecuteAsync(
DocumentState state,
StepContext context,
CancellationToken ct)
{
// Agent execution handled by generated worker
return StepResult<DocumentState>.FromState(state);
}
}
Enable per-agent conversation threads for context retention:
public record MyState : IWorkflowState, IConversationalState
{
public Guid WorkflowId { get; init; }
public ImmutableDictionary<string, string> SerializedThreads { get; init; }
= ImmutableDictionary<string, string>.Empty;
public IConversationalState WithSerializedThread(string agentType, string thread)
=> this with { SerializedThreads = SerializedThreads.SetItem(agentType, thread) };
}
Handle real-time token streaming:
public class WebSocketStreamingCallback : IStreamingCallback
{
public async Task OnTokenReceivedAsync(
string token, Guid workflowId, string stepName, CancellationToken ct)
{
await _hubContext.Clients.Group(workflowId.ToString())
.SendAsync("TokenReceived", token, ct);
}
public async Task OnResponseCompletedAsync(
string fullResponse, Guid workflowId, string stepName, CancellationToken ct)
{
await _hubContext.Clients.Group(workflowId.ToString())
.SendAsync("ResponseCompleted", fullResponse, ct);
}
}
services.AddAgenticWorkflowAgents()
.AddConversationThreadManager<MyThreadManager>()
.AddStreamingCallback<WebSocketStreamingCallback>();| Interface | Purpose |
|---|---|
IAgentStep<TState> | Workflow step powered by LLM agent |
IConversationalState | State with per-agent conversation threads |
IConversationThreadManager | Manages conversation thread lifecycle |
IStreamingCallback | Handles real-time token streaming |
MIT