Graph-based workflow management paradigm for efficient LLM agent serving using unified directed graphs (wGraph) for dynamic workflow instantiation with KV-cache optimization. Use for LLM agent serving, workflow management, agent serving optimization, agent orchestration, KV-cache management.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill graphflow-llm-agent-serving --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Graphflow Llm Agent Serving?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-graphflow-llm-agent-serving)More formats (shields.io, HTML) on the badges page.
---
name: graphflow-llm-agent-serving
description: Graph-based workflow management paradigm for efficient LLM agent serving using unified directed graphs (wGraph) for dynamic workflow instantiation with KV-cache optimization. Use for LLM agent serving, workflow management, agent serving optimization, agent orchestration, KV-cache management.
---
# GraphFlow: Graph-Based Workflow Management for LLM-Agent Serving
**Paper:** arXiv:2605.22566 (2026-05-21)
**Authors:** Ao Li et al.
## Overview
GraphFlow proposes a new workflow management paradigm for LLM-based agent serving systems. Instead of relying on predefined templates and shallow pattern matching, it represents workflows using a unified directed graph called **wGraph**, where each node corresponds to an atomic operation. wGraph serves as a shared substrate from which task-specific workflows are dynamically instantiated.
## Core Concepts
### 1. wGraph — Unified Graph Representation
- A directed graph where **nodes** represent atomic operations (tool calls, reasoning steps, API invocations, etc.)
- **Edges** represent dependencies and data flow between operations
- wGraph serves as a **shared substrate** — a reusable library of primitives that multiple tasks can compose from
- Supports hierarchical composition: subgraphs can be nested within nodes for modularity
- Contrast with existing systems: rather than matching tasks against rigid templates, wGraph enables dynamic composition
### 2. Adaptive Workflow Generation
GraphFlow dynamically constructs task-specific workflows from wGraph based on:
- **Task semantics**: Natural language task descriptions are parsed and mapped to relevant wGraph nodes
- **Constraint requirements**: User-specified or inferred constraints (e.g., latency bounds, cost limits, tool availability) guide which subgraph is selected
- **Runtime context**: Current state of the serving system (cache state, tool availability) influences workflow construction
- The generation process produces a **task-specific workflow instance** — a subgraph of wGraph that satisfies the task's requirements
### 3. Workflow State Management for KV-Cache Optimization
GraphFlow exploits wGraph structure to reduce redundant computation during agent serving:
- **Structural KV-cache reuse**: Identifies shared prefixes in wGraph subpaths — if two workflows share a common sequence of atomic operations, the KV cache from the first can be reused by the second
- **Cache-aware scheduling**: When selecting which workflow instance to run, considers cached states to minimize recomputation
- **Incremental execution**: Workflow steps that depend only on cached outputs skip re-execution
- Achieves approximately **4x memory reduction** in KV-cache storage
## Methodology
### wGraph Construction
1. Identify all atomic operations available in the agent serving system (tools, models, APIs, logic steps)
2. Define dependency edges between operations based on input/output compatibility
3. Optionally compose subgraphs for common multi-step patterns
4. Store as a versioned wGraph that can be updated as new operations are added
### Adaptive Workflow Generation Process
1. **Task parsing**: Analyze user request to extract semantic intent and required capabilities
2. **Node selection**: Query wGraph to identify candidate nodes matching required capabilities
3. **Constraint filtering**: Apply constraints (latency, cost, availability) to prune candidate nodes
4. **Path construction**: Build a directed path/subgraph satisfying the task requirements
5. **Instance instantiation**: Materialize the workflow instance with concrete parameters
### KV-Cache State Management
1. Maintain a **state registry** mapping wGraph node sequences to cached KV states
2. On workflow generation, query the registry for existing cached prefixes
3. Schedule execution to maximize cache hits
4. Evict stale caches based on recency and frequency of access
5. Update registry after each execution
## Results
- **~4.95 percentage points** average improvement in task completion success rate
- **~4x reduction** in KV-cache memory consumption
- More robust handling of diverse, unseen task types compared to template-based baselines
## Use Cases
- **LLM agent serving platforms**: Serving systems hosting multi-agent applications with diverse tasks
- **Workflow orchestration**: Systems that need to dynamically compose tool calls and LLM reasoning steps
- **Agent serving optimization**: Systems seeking to reduce computational overhead through intelligent caching
- **Multi-tenant agent infrastructure**: Platforms where different tenants submit different task types sharing common primitives
## Key Advantages
- **Dynamic composition** — no reliance on rigid templates
- **Shared substrate** — atomic operations are reusable across tasks
- **Cache efficiency** — structural KV-cache reuse from shared subgraph prefixes
- **Constraint-aware** — workflow generation respects latency, cost, and availability constraints
- **Extensible** — new operations simply add nodes to wGraph without modifying existing workflows
## Architecture Diagram (Conceptual)
```
┌─────────────────────────────┐
│ wGraph Repository │
│ (Unified Graph of Atomic │
│ Operations & Dependencies) │
└──────────┬──────────────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Adaptive │ │ Task │ │ KV-Cache │
│ Workflow │──│ Semantics │ │ State │
│ Generator │ │ Parser │ │ Manager │
└──────┬───────┘ └──────────────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────────────────────────────────────┐
│ Task-Specific Workflow Instance │
│ (Instantiated Subgraph of wGraph) │
└──────────────────────────────────────────────┘
```
## References
- arXiv:2605.22566 — GraphFlow: A Graph-Based Workflow Management for Efficient LLM-Agent Serving
- Related work in LLM agent serving, workflow management systems, and KV-cache optimization techniques
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!