RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cline rules/ssdeanx/langgraph-dm

Cline rules

.clinerules/subgraphs.md

Langgraph Subgraphs & Workflow Orchestration

Cline rules

Quality

48/100

Scores the file, not the repository.

Length

537 words

6 headings · 0 code blocks

Repository

0

— · pushed 392 days ago

Last changed

3 days ago

First indexed 3 days ago.
ssdeanx/langgraph-dm/.clinerules/subgraphs.mdRawGitHub
1---
2glob: "**/*.ts"
3description: "Langgraph Subgraphs & Workflow Orchestration"
4---
5# Subgraphs and Workflow Orchestration
6 
7## LangGraph Core Concept
8 
9* This project heavily utilizes LangGraph's `StateGraph` to define and manage complex, multi-step AI agent workflows.
10* A "graph" represents the flow of control and data between different nodes (which are typically agents or tool calls).
11* Subgraphs allow you to reuse an existing graph as a node within another graph, promoting modularity and hierarchical organization.
12 
13## Key Components
14 
15* **Nodes:** Represent individual steps or agents in the workflow (e.g., `entryNode`, `supervisor`, `reactAgent`, `research_collectNode`). Each node takes the current `AgentState` as input and returns an updated state.
16* **Edges:** Define the transitions between nodes.
17 * **Normal Edges:** Unconditionally move from one node to another (e.g., `START` to `entry`, `chat` to `END`).
18 * **Conditional Edges:** Route to different nodes based on a decision function (e.g., `routeMessages` from `supervisor` to various agents). The routing function takes the `AgentState` and returns the name of the next node(s) or `END`.
19* **`AgentState`:** The central data structure that is passed and modified across all nodes in the graph, maintaining the conversation context and agent-specific data. Defined using `Annotation`.
20* **Supervisor:** A critical node responsible for intelligently routing the `AgentState` to the appropriate specialized agent or action based on the current context and goal.
21* **`Command` Primitive:** Allows combining state updates and control flow (routing) within a single node, useful for dynamic handoffs between agents.
22 
23## Designing Subgraphs
24 
25* **Modularity:** Complex workflows should be broken down into smaller, manageable subgraphs or sequences of nodes.
26* **Clear Responsibilities:** Each node and subgraph should have a clear, single responsibility.
27* **State Flow:** Pay close attention to how data flows through the `AgentState` between nodes to ensure necessary information is available at each step.
28* **Error Handling:** Design subgraphs to handle errors gracefully, potentially returning control to a supervisor for re-routing or error reporting.
29* **Routing Logic:** The `routeMessages` function (or similar conditional routing) is crucial for dynamic and intelligent workflow execution. Ensure its logic covers all necessary transitions and fallback scenarios.
30* **Communication:**
31 * If the parent graph and subgraph share schema keys (channels), the compiled subgraph can be added directly as a node.
32 * If schemas are different, define a node function that explicitly invokes the subgraph, transforming input state and output results to match the parent's schema. This prevents errors due to non-overlapping channels.
33* **Nesting:** Subgraphs can be nested to any level, allowing for highly complex hierarchical agent systems.
34 
35## Example Flows
36 
37* **General Conversation:** `entry` -> `supervisor` -> `chat` -> `END`
38* **Research Task:** `entry` -> `supervisor` -> `research_collect` -> `research_summarize` -> `research_report` -> `supervisor` (for final response)
39* **Documentation Task:** `entry` -> `supervisor` -> `draft_documentation` -> `finalize_documentation` -> `supervisor` (for final response)
40* **React Agent Task:** `entry` -> `supervisor` -> `react` -> `supervisor` (for tool execution or further action)
41* **Multi-agent Network:** Agents can communicate with each other in a many-to-many fashion, making decisions on which agent to call next (e.g., `travel_advisor` -> `sightseeing_advisor` -> `hotel_advisor`).
42 
43## Persistence with Subgraphs
44 
45* Checkpointers should be passed only when compiling the *parent* graph. LangGraph automatically propagates the checkpointer to child subgraphs, enabling persistence across nested levels.
46* State of subgraphs can be viewed and updated, facilitating human-in-the-loop interactions and debugging within nested workflows.
47 

Sections

  • Subgraphs and Workflow Orchestration
  • LangGraph Core Concept
  • Key Components
  • Designing Subgraphs
  • Example Flows
  • Persistence with Subgraphs

What it covers

agent-behaviour

Stack — with the evidence

typescript

(1.00)

langchain

(1.00)

jest

(1.00)

eslint

(1.00)

javascript

(0.60)

Format

Cline rules

A single file or a folder of files, all always-on. The folder form is the simplest way any format here lets you split rules into topics without also learning an activation model.

What the corpus says about it

Repository

Owner
ssdeanx
Language
—
License
—
Archived
no

All configs in this repo

Also in ssdeanx/langgraph-dm

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
ssdeanx/langgraph-dm.clinerules/memory.md · 0Cline rulestypescriptlangchain+3styleperformance43/1003 days ago
ssdeanx/langgraph-dm.clinerules/agents.md · 0Cline rulestypescriptlangchain+3typesagent-behaviour44/1003 days ago
ssdeanx/langgraph-dm.clinerules/development_guidelines.md · 0Cline rulestypescriptlangchain+3setupbuildtestlint-format+383/1003 days ago
ssdeanx/langgraph-dm.clinerules/docs-technical-style.md · 0Cline rulestypescriptlangchain+3setuplint-formatstyledocs53/1003 days ago
ssdeanx/langgraph-dm.clinerules/langgraphjs.md · 0Cline rulestypescriptlangchain+3arch52/1003 days ago
ssdeanx/langgraph-dm.clinerules/project_overview.md · 0Cline rulestypescriptlangchain+3testlint-formatstylearch75/1003 days ago
ssdeanx/langgraph-dm.github/copilot-instructions.md · 0Copilot instructionstypescriptlangchain+3setupsecuritydeploymentdo-not+257/1003 days ago
ssdeanx/langgraph-dm.windsurf/rules/graphs.md · 0Windsurf rulestypescriptlangchain+3do-not55/1003 days ago
ssdeanx/langgraph-dm.windsurf/rules/langsmith.md · 0Windsurf rulestypescriptlangchain+3do-notagent-behaviour55/1003 days ago
Diff against .clinerules/memory.md Diff against .clinerules/agents.md Diff against .clinerules/development_guidelines.md Diff against .clinerules/docs-technical-style.md Diff against .clinerules/langgraphjs.md Diff against .clinerules/project_overview.md Diff against .github/copilot-instructions.md Diff against .windsurf/rules/graphs.md Diff against .windsurf/rules/langsmith.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5Cline rulestypescriptnode+8setupbuildtestlint-format+11100/1003 days ago
JCodesMore/ai-website-cloner-template.clinerules · 31kCline rulestypescriptnode+7buildlint-formatstylearch+397/1002 days ago
u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1Cline rulestypescriptvite+4setuparchtypesdo-not93/100yesterday
blendsdk/codeops-mcp.clinerules/project.md · 0Cline rulestypescriptvitest+3buildteststylearch+791/1003 days ago
cline/cline.clinerules/general.md · 66kCline rulestypescriptnode+12setupbuildstylearch+286/1003 days ago
u9401066/zotero-keeper.clinerules/60-pubmed-python.md · 6Cline rulespytestruff+6setuptestlint-formatstyle+286/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack