← スキル䞀芧に戻る
eco2-team

langgraph-pipeline

by eco2-team

🌱 읎윔에윔(Eco²) BE

⭐ 0🍎 0📅 2026幎1月25日
GitHubで芋るManusで実行

SKILL.md


name: langgraph-pipeline description: LangGraph 1.0+ 파읎프띌읞 구축 가읎드. Intent-Routed Workflow, Subagent 팹턮, Checkpointing, Conditional Routing 구현 시 ì°žì¡°. "langgraph", "pipeline", "graph", "workflow", "subagent", "checkpointer" 킀워드로 튞늬거.

LangGraph Pipeline Guide (v1.0+)

Eco² 파읎프띌읞 아킀텍처

┌─────────────────────────────────────────────────────────────────────────┐
│                    Intent-Routed Workflow with Subagent                  │
├──────────────────────────────────────────────────────────────────────────
│                                                                          │
│  START → intent → [vision?] → router ──┬─→ waste ────────┐              │
│                              │         ├─→ character ─────              │
│                              │         ├─→ location ────────→ answer → END
│                              │         ├─→ web_search ────              │
│                              │         └─→ general ──────┘              │
│                              │                                           │
│                              └─→ [feedback_loop] ─→ answer              │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

StateGraph Ʞ볞 팹턮

Graph 생성 및 컎파음

from langgraph.graph import END, StateGraph

# State는 TypedDict 또는 dict 사용
graph = StateGraph(dict)

# 녾드 추가
graph.add_node("intent", intent_node)
graph.add_node("router", router_node)
graph.add_node("answer", answer_node)

# 엣지 추가
graph.add_edge("intent", "router")
graph.add_edge("answer", END)

# 조걎부 띌우팅
graph.add_conditional_edges(
    "router",
    route_by_intent,  # 띌우팅 핚수
    {
        "waste": "waste_node",
        "character": "character_node",
        "general": "answer",
    }
)

# 시작점 섀정 및 컎파음
graph.set_entry_point("intent")
compiled = graph.compile(checkpointer=checkpointer)

Node 정의 팹턮

async def intent_node(state: dict) -> dict:
    """녾드는 state륌 받아 업데읎튞할 필드만 반환"""
    intent = await classifier.classify(state["query"])
    return {
        "intent": intent.value,
        "confidence": intent.confidence,
    }

Checkpointing (Cache-Aside 팹턮)

L1: Redis + L2: PostgreSQL

from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver

class CachedPostgresSaver(BaseCheckpointSaver):
    """Redis L1 캐시 + PostgreSQL L2 영속 저장소"""

    def __init__(
        self,
        redis: Redis,
        pg_saver: AsyncPostgresSaver,
        ttl: int = 3600,
    ):
        self._redis = redis
        self._pg = pg_saver
        self._ttl = ttl

    async def aget(
        self,
        config: RunnableConfig,
    ) -> Checkpoint | None:
        thread_id = config["configurable"]["thread_id"]
        key = f"checkpoint:{thread_id}"

        # L1 캐시 조회
        cached = await self._redis.get(key)
        if cached:
            return self._deserialize(cached)

        # L2 조회 후 L1 캐시
        checkpoint = await self._pg.aget(config)
        if checkpoint:
            await self._redis.setex(
                key,
                self._ttl,
                self._serialize(checkpoint)
            )
        return checkpoint

Conditional Routing

의도 êž°ë°˜ 띌우팅

def route_by_intent(state: dict) -> str:
    """의도에 따띌 닀음 녾드 결정"""
    intent = state.get("intent", "general")

    routing_map = {
        "waste_query": "waste_node",
        "character_query": "character_node",
        "location_query": "location_node",
        "web_search": "web_search_node",
    }

    return routing_map.get(intent, "answer")

조걎부 진입/슀킵

def should_use_vision(state: dict) -> str:
    """읎믞지 졎재 여부로 vision 녾드 사용 결정"""
    if state.get("image_url"):
        return "vision"
    return "router"

graph.add_conditional_edges(
    "intent",
    should_use_vision,
    {
        "vision": "vision_node",
        "router": "router_node",
    }
)

Subagent 통합 팹턮

gRPC Client 죌입

def create_chat_graph(
    llm: LLMClientPort,
    retriever: RetrieverPort,
    character_client: CharacterClientPort | None = None,
    location_client: LocationClientPort | None = None,
    checkpointer: BaseCheckpointSaver | None = None,
) -> StateGraph:
    """Port êž°ë°˜ 의졎성 죌입윌로 Subagent 통합"""

    graph = StateGraph(dict)

    # Subagent 녾드는 큎띌읎얞튞가 죌입된 겜우에만 추가
    if character_client:
        graph.add_node(
            "character",
            create_character_node(character_client)
        )

    if location_client:
        graph.add_node(
            "location",
            create_location_node(location_client)
        )

    return graph.compile(checkpointer=checkpointer)

Reference Files

LangGraph 1.0 변겜사항

항목변겜 전변겜 후
Prebuilt agentslanggraph.prebuiltlangchain.agents (deprecated)
Breaking changes-없음
Checkpointer동음동음
StateGraph API동음동음

Note: LangGraph 1.0.0 늎늬슈는 zero breaking changes. Ʞ졎 윔드 혾환.

スコア

総合スコア

60/100

リポゞトリの品質指暙に基づく評䟡

✓SKILL.md

SKILL.mdファむルが含たれおいる

+20
✓LICENSE

ラむセンスが蚭定されおいる

+10
○説明文

100文字以䞊の説明がある

0/10
○人気

GitHub Stars 100以䞊

0/15
○最近の掻動

3ヶ月以内に曎新がある

0/10
○フォヌク

10回以䞊フォヌクされおいる

0/5
✓Issue管理

オヌプンIssueが50未満

+5
✓蚀語

プログラミング蚀語が蚭定されおいる

+5
○タグ

1぀以䞊のタグが蚭定されおいる

0/5

レビュヌ

💬

レビュヌ機胜は近日公開予定です