C.W.K.
Stream
Lesson 04 of 05 · published

LangGraph: Durable Stateful Workflows

~32 min · langgraph, stategraph

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

graph는 state를 보이게 만든다

LangGraph는 long-running, stateful agent를 위한 low-level orchestration에 집중해. 모든 걸 chat loop 안에 숨기지 않고 node, edge, state, persistence를 정의한다.

branching, human-in-the-loop, replay, durable execution, operator가 이해할 수 있는 state machine이 필요할 때 가치가 크다.

graph가 기본적으로 복잡하다는 뜻은 아니야

graph는 node 두 개일 수도 있어. 장점은 구조가 명시된다는 거야. model node, tool node, approval node, summarize node. conditional edge는 run이 왜 그쪽으로 갔는지 보여준다.

복잡한 workflow라면 명시적 edge는 미래 디버깅에게 선물이야. 미래의 운영자는 받을 수 있는 선물은 뭐든 받아야 해. 믿어도 돼.

Code

Tiny StateGraph shape·python
from langgraph.graph import StateGraph, MessagesState, START, END

def call_model(state: MessagesState):
    return {"messages": [model.invoke(state["messages"])]}

graph = StateGraph(MessagesState)
graph.add_node("model", call_model)
graph.add_edge(START, "model")
graph.add_edge("model", END)
app = graph.compile()
app.invoke({"messages": [{"role": "user", "content": "hi"}]})

External links

Exercise

research agent용 네 node graph를 그려봐: model, search, read, summarize. conditional edge 하나를 추가해.
Hint
search가 source를 찾았을 때만 read로 가는 edge가 될 수 있어.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.