Langgraph logo

Langgraph

Community
Omar-Obando
langgraph

Use when building stateful agents and workflows with LangGraph, implementing graph-based architectures, managing state persistence, human-in-the-loop capabilities, and multi-agent systems. Includes Python and JavaScript implementations. Based on LangChain/LangGraph official documentation and agent development best practices.

Overview

PublisherOmar-Obando
Repositoryqwen-orchestrator
Skill namelanggraph
Stars
53
Forks
13
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Omar-Obando on GitHub. Read the source before you install it.

Installation

Install the Langgraph AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/langgraph
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/langgraph .claude/skills/langgraph
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Langgraph in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Langgraph on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Langgraph is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

LangGraph Skill — Stateful Agents & Graph Workflows

Overview

This skill provides comprehensive guidance for building stateful agents and workflows with LangGraph, implementing graph-based architectures, managing state persistence, human-in-the-loop capabilities, and multi-agent systems. It includes Python and JavaScript implementations. Based on LangChain/LangGraph official documentation and agent development best practices.

When to Use

Use this skill when:

  • Building stateful agents with LangGraph
  • Implementing graph-based architectures with StateGraph
  • Managing state persistence and checkpoints
  • Creating human-in-the-loop workflows with interrupts
  • Building multi-agent systems with handoffs
  • Implementing durable execution and memory
  • Using checkpointer strategies (InMemory, SQLite, PostgreSQL)
  • Implementing thread management and session persistence
  • Building agent swarms with LangGraph Swarm
  • Creating conditional edges and routing logic
  • Implementing agent communication patterns
  • Setting up LangGraph Studio for debugging
  • Using LangSmith for tracing and monitoring
  • Building agents with tool calling capabilities
  • Implementing retry and error handling patterns
  • Creating agents with streaming output
  • Building agents with context window management
  • Implementing agent memory with vector stores
  • Creating agents with external knowledge sources
  • Building agents with multi-step reasoning

Do NOT use this skill when:

  • Building basic LLM applications without state (use llm-integrations skill)
  • Designing database schema (use database-design skill)
  • Creating UI components (use frontend-design skill)
  • Writing simple prompt templates (use langchain skill for basic LLM operations)
  • Implementing non-agent workflows (use standard application development skill)
  • Building simple chat applications without complex state (use qwen-agent skill for Qwen-specific apps)
  • Managing agent teams across multiple agents (use agent-task-coordinator skill)

Why avoid: LangGraph adds complexity with state management and checkpoints. For simple LLM apps, use lighter-weight solutions.

Core Concepts

State Management

python
# Python
from typing import Annotated
from langgraph.graph import StateGraph
from langgraph.checkpoint.memory import InMemorySaver

class State(TypedDict):
    messages: Annotated[list, add_messages]
    current_agent: str

workflow = StateGraph(State)
checkpointer = InMemorySaver()
app = workflow.compile(checkpointer=checkpointer)
typescript
// JavaScript
import { MemorySaver } from '@langchain/langgraph';
import { StateGraph } from '@langchain/langgraph';

const checkpointer = new MemorySaver();
const workflow = new StateGraph(State);
const app = workflow.compile({ checkpointer });

Graph Patterns

python
# Sequential Pattern
workflow = (
    StateGraph(State)
    .add_node("researcher", research_node)
    .add_node("writer", write_node)
    .add_edge("researcher", "writer")
    .set_entry_point("researcher")
    .set_finish_point("writer")
)

# Conditional Pattern
def route_message(state: State) -> str:
    if state["current_agent"] == "Alice":
        return "Bob"
    return "Alice"

workflow = (
    StateGraph(State)
    .add_node("Alice", alice_node)
    .add_node("Bob", bob_node)
    .add_conditional_edges("Alice", route_message, ["Bob"])
    .add_conditional_edges("Bob", route_message, ["Alice"])
)

Multi-Agent Systems

Basic Swarm

python
from langgraph.checkpoint.memory import InMemorySaver
from langchain.agents import create_agent
from langgraph_swarm import create_swarm

def add(a: int, b: int) -> int:
    '''Add two numbers'''
    return a + b

alice = create_agent(
    "openai:gpt-4o",
    tools=[add],
    system_prompt="You are Alice, an addition expert.",
    name="Alice",
)

bob = create_agent(
    "openai:gpt-4o",
    system_prompt="You are Bob, you speak like a pirate.",
    name="Bob",
)

checkpointer = InMemorySaver()
workflow = create_swarm([alice, bob], default_active_agent="Alice")
app = workflow.compile(checkpointer=checkpointer)

config = {"configurable": {"thread_id": "1"}}
result = app.invoke({"messages": [{"role": "user", "content": "Hello"}]}, config)

Agent Handoffs

python
from langgraph_swarm import create_handoff_tool

alice = create_agent(
    "openai:gpt-4o",
    tools=[
        add,
        create_handoff_tool(
            agent_name="Bob",
            description="Transfer to Bob for pirate-related questions",
        ),
    ],
    system_prompt="You are Alice, an addition expert.",
    name="Alice",
)

bob = create_agent(
    "openai:gpt-4o",
    tools=[
        create_handoff_tool(
            agent_name="Alice",
            description="Transfer to Alice for math questions",
        ),
    ],
    system_prompt="You are Bob, you speak like a pirate.",
    name="Bob",
)

Active Agent Router

python
from langgraph_swarm import add_active_agent_router

workflow = (
    StateGraph(SwarmState)
    .add_node(alice, destinations=("Bob",))
    .add_node(bob, destinations=("Alice",))
)

workflow = add_active_agent_router(
    builder=workflow,
    route_to=["Alice", "Bob"],
    default_active_agent="Alice",
)

app = workflow.compile(checkpointer=checkpointer)

State Persistence

Checkpointers

python
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.checkpoint.sqlite import SqliteSaver
from langgraph.checkpoint.postgres import PostgresSaver

# In-memory (development)
checkpointer = InMemorySaver()

# SQLite (production)
checkpointer = SqliteSaver.from_conn_string(":memory:")

# PostgreSQL (production)
checkpointer = PostgresSaver.from_conn_string("postgresql://user:pass@localhost/db")

Thread Management

python
config = {"configurable": {"thread_id": "user-123"}}

# First invocation
result = app.invoke({"messages": [{"role": "user", "content": "Hello"}]}, config)

# Subsequent invocation (state preserved)
result = app.invoke({"messages": [{"role": "user", "content": "Continue"}]}, config)

# Stream results
for chunk in app.stream({"messages": [{"role": "user", "content": "Stream"}]}, config):
    print(chunk)

Human-in-the-Loop

Interrupts

python
from langgraph.func import entrypoint, task
from langgraph.types import interrupt

@task
def compose_essay(topic: str) -> str:
    return f"An essay about {topic}"

@entrypoint(checkpointer=InMemorySaver())
def review_workflow(topic: str) -> dict:
    essay_future = compose_essay(topic)
    essay = essay_future.result()

    # Human review
    human_review = interrupt({
        "question": "Please provide a review",
        "essay": essay
    })

    return {
        "essay": essay,
        "review": human_review,
    }

# Resume with human input
config = {"configurable": {"thread_id": "review-1"}}
human_review = "This essay is great."
result = app.invoke(Command(resume=human_review), config)

Checkpointing

python
# Get checkpoint history
config = {"configurable": {"thread_id": "user-123"}}
history = list(app.get_state_history(config))

# Resume from specific checkpoint
for state in history:
    if state.next == ["review_node"]:
        # Resume from this checkpoint
        app.update_state(state.config, {"review": "approved"})

Best Practices

1. Use Checkpointers for State Persistence

python
# ✅ GOOD: With checkpointing
checkpointer = InMemorySaver()
app = workflow.compile(checkpointer=checkpointer)

# ❌ BAD: Without checkpointing
app = workflow.compile()  # No state persistence

2. Design Graphs with Clear Boundaries

python
# ✅ GOOD: Clear node boundaries
workflow = (
    StateGraph(State)
    .add_node("input_validation", validate_input)
    .add_node("llm_processing", process_with_llm)
    .add_node("output_formatting", format_output)
    .add_edge("input_validation", "llm_processing")
    .add_edge("llm_processing", "output_formatting")
)

# ❌ BAD: Unclear boundaries
workflow = StateGraph(State)
# All logic in one node - hard to test and maintain

3. Use Type Hints for State

python
# ✅ GOOD: Typed state
from typing import TypedDict

class State(TypedDict):
    messages: list
    current_agent: str
    user_context: dict

# ❌ BAD: Untyped state
class State:
    messages = []
    current_agent = ""
    user_context = {}

4. Implement Error Handling

python
# ✅ GOOD: Error handling in nodes
def process_with_llm(state: State) -> State:
    try:
        result = llm.invoke(state["messages"])
        return {**state, "response": result}
    except Exception as e:
        return {**state, "error": str(e)}

# ❌ BAD: No error handling
def process_with_llm(state: State) -> State:
    result = llm.invoke(state["messages"])  # Can crash
    return {**state, "response": result}

Common Anti-Patterns

❌ Bad: No State Management

python
# ❌ BAD: No state management
def process(state: State) -> State:
    # No persistence, no checkpointing
    result = llm.invoke(state["messages"])
    return {"response": result}

Problems:

  • No state persistence
  • Cannot resume workflows
  • No human-in-the-loop support

✅ Good: With State Management

python
# ✅ GOOD: With state management
class State(TypedDict):
    messages: list
    response: Optional[str]

def process(state: State) -> State:
    result = llm.invoke(state["messages"])
    return {**state, "response": result}

checkpointer = InMemorySaver()
app = workflow.compile(checkpointer=checkpointer)

❌ Bad: Complex Graphs

python
# ❌ BAD: Complex graph with many edges
workflow = (
    StateGraph(State)
    .add_node("a", node_a)
    .add_node("b", node_b)
    .add_node("c", node_c)
    .add_node("d", node_d)
    # Many conditional edges - hard to understand
)

Problems:

  • Hard to understand
  • Difficult to debug
  • Maintenance challenges

✅ Good: Simple Graphs

python
# ✅ GOOD: Simple graph
workflow = (
    StateGraph(State)
    .add_node("input", validate_input)
    .add_node("process", process_with_llm)
    .add_node("output", format_output)
    .add_edge("input", "process")
    .add_edge("process", "output")
)

Real-World Impact

Before this skill:

  • No state persistence
  • Difficult multi-agent systems
  • No human-in-the-loop
  • Complex state management

After this skill:

  • State persistence with checkpoints
  • Easy multi-agent systems
  • Human-in-the-loop support
  • Clean state management

Cross-References

  • langchain - For LLM integration
  • qwen-agent - For Qwen-specific agents
  • llm-integrations - For LLM provider configuration

References

Frequently asked questions

What does the Langgraph AI skill do?

Use when building stateful agents and workflows with LangGraph, implementing graph-based architectures, managing state persistence, human-in-the-loop capabilities, and multi-agent systems. Includes Python and JavaScript implementations. Based on LangChain/LangGraph official documentation and agent development best practices.

Why use Langgraph on TypingMind?

Because you install it once and use it with any model. Langgraph is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Langgraph in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/langgraph. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Langgraph?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Langgraph?

As many as you like. As long as a model supports skills, you can use Langgraph with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Langgraph AI skill free?

Yes. It is published on GitHub by Omar-Obando under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇