Skip to content

Semantic Kernel Graph

Welcome to the SemanticKernel.Graph documentation. This site mirrors the LangGraph documentation structure, focusing on a lean and pragmatic .NET implementation that's fully integrated with Semantic Kernel.

Concepts and Techniques

SemanticKernel.Graph: Extension of Semantic Kernel that adds computational graph execution capabilities, allowing you to create complex workflows with intelligent orchestration.

Computational Graphs: Structures that represent workflows through nodes connected by edges, with controlled execution and conditional routing.

Native Integration: Works as an extension of the existing Semantic Kernel, maintaining full compatibility and leveraging existing plugins and services.

What SemanticKernel.Graph Solves

Orchestration Problems

  • Complex Workflows: Creation of AI pipelines with multiple steps
  • Intelligent Routing: Decisions based on state and context
  • Flow Control: Loops, conditionals and controlled iterations
  • Composition: Reuse of components and subgraphs

Production Challenges

  • Scalability: Parallel and distributed execution
  • Resilience: Checkpointing, retry and circuit breakers
  • Observability: Metrics, logging and real-time visualization
  • Maintainability: Debug, inspection and automatic documentation

Core Features

Graph Execution

  • Function, conditional, reasoning and loop nodes
  • Edges with conditions and dynamic routing
  • Sequential, parallel and distributed execution
  • Deterministic scheduler for reproducibility

Streaming and Events

  • Streaming execution with real-time events
  • Automatic reconnection and backpressure control
  • Asynchronous consumption of execution events
  • Integration with messaging systems

State and Persistence

  • Typed and validated state system
  • Automatic and manual checkpointing
  • State serialization and compression
  • Execution recovery and replay

Intelligent Routing

  • State-based conditional routing
  • Dynamic and adaptive strategies
  • Semantic similarity for decisions
  • Learning from feedback

Human-in-the-Loop

  • Human approval nodes
  • Multiple channels (console, web, email)
  • Timeouts and SLA policies
  • Audit and decision tracking

Integration and Extensibility

  • Integrated REST tools
  • Extensible plugin system
  • Integration with external services
  • Templates for common workflows

Get Started in Minutes

1. Quick Installation

dotnet add package SemanticKernel.Graph

2. First Graph

builder.AddGraphSupport();
var kernel = builder.Build();

// Create graph executor (not a Graph class)
var executor = new GraphExecutor("MyGraph", "My first graph");

// Add nodes and edges
executor.AddNode(startNode);
executor.AddNode(processNode);
executor.AddNode(endNode);

executor.SetStartNode(startNode.NodeId);
executor.AddEdge(ConditionalEdge.CreateUnconditional(startNode, processNode));
executor.AddEdge(ConditionalEdge.CreateUnconditional(processNode, endNode));

// Execute the graph
var result = await executor.ExecuteAsync(kernel, arguments);

Important Note: The SemanticKernel.Graph library uses GraphExecutor class, not a Graph class. This is different from some other graph libraries. The GraphExecutor serves both as the graph definition and execution engine.

Documentation Structure

Get Started

Concepts

  • Graphs - Structure and components
  • Nodes - Types and lifecycle
  • Execution - Modes and control
  • Routing - Strategies and conditions
  • State - Management and persistence

How-To Guides

Reference

Examples

Use Cases

AI Agents

  • Chatbots with memory and context
  • Reasoning agents (ReAct, Chain of Thought)
  • Coordination of multiple agents
  • Automated decision workflows

Document Processing

  • Automatic analysis and classification
  • Structured information extraction
  • Validation and approval pipelines
  • Batch processing with checkpoints

Recommendation Systems

  • Similarity-based routing
  • Learning from user feedback
  • Conditional filters and personalization
  • Continuous result optimization

Microservice Orchestration

  • API call coordination
  • Circuit breakers and retry policies
  • Intelligent load balancing
  • Monitoring and observability

Comparison with Alternatives

Feature SemanticKernel.Graph LangGraph Temporal Durable Functions
SK Integration ✅ Native ❌ Python ❌ Java/Go ❌ Azure
Performance ✅ Native .NET ⚠️ Python ✅ JVM ✅ Azure Runtime
Checkpointing ✅ Advanced ✅ Basic ✅ Robust ✅ Native
Streaming ✅ Events ✅ Streaming ⚠️ Limited
Visualization ✅ Real Time ✅ Static
HITL ✅ Multiple Channels ⚠️ Basic

Community and Support

Contribute

Additional Resources

Need Help?

Quickstarts

5 Minutes

15 Minutes

30 Minutes


Tip: This documentation uses Material for MkDocs. Use the left navigation and search bar to quickly find topics.

Ready to get started? Go to Installation or First Graph to begin in minutes!