โ Back to list

langgraph-pipeline
by eco2-team
๐ฑ ์ด์ฝ์์ฝ(Ecoยฒ) BE
โญ 0๐ด 0๐
Jan 25, 2026
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
- Graph ํจํด: See graph-patterns.md
- Checkpointing: See checkpointing.md
- State ๊ด๋ฆฌ: See state-management.md
- ํ ์คํธ ํจํด: See testing-patterns.md
LangGraph 1.0 ๋ณ๊ฒฝ์ฌํญ
| ํญ๋ชฉ | ๋ณ๊ฒฝ ์ | ๋ณ๊ฒฝ ํ |
|---|---|---|
| Prebuilt agents | langgraph.prebuilt | langchain.agents (deprecated) |
| Breaking changes | - | ์์ |
| Checkpointer | ๋์ผ | ๋์ผ |
| StateGraph API | ๋์ผ | ๋์ผ |
Note: LangGraph 1.0.0 ๋ฆด๋ฆฌ์ฆ๋ zero breaking changes. ๊ธฐ์กด ์ฝ๋ ํธํ.
Score
Total Score
60/100
Based on repository quality metrics
โ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
Reviews
๐ฌ
Reviews coming soon