Skip to main content

1.Langgrah Intro

Langgraph의 필요성

  • 완전 자율 AI에게 명령은 계획, 설계, 실행, 재귀적 테스트 수행을 한다. 이것이 위험이다.
  • 어떤 방향성으로 진행 되는지 모르며, '할루이네이션 폭팔' 현상이 발생한다.
  • 하지만 너무 LLM을 정해진 틀 안에서 사용하는것은 AI의 가능성을 제한한다. 그 정답은 사이에 있으며 lang graph가 그것을 구현해준다.
  • 따라서 자율적인 AI의 장점과 + 의도한 결과물까지 정합성 2가지를 모두 챙길 수 있는 에이전트 런타임이다.

Langgraph : LLM을 State Machine 기반 워크플로우 안에서 통제하는 에이전트 런타임.

Github : https://github.com/emarco177/langgraph-course/tree/main

Agent 패턴

Agent 패턴핵심 개념대표 흐름주요 목적LangGraph 핵심 요소실무 활용 예시
ReAct AgentThought + Action + Observation loopReason → Tool → Observe → Repeat기본 tool calling agentloop edge, tool node검색 봇, API assistant
Router Agent질문별 routingQuery → Classifier → Specialized Agenttask 분기conditional edge코드/검색/금융 분리
Supervisor Multi-Agent상위 agent가 하위 agent orchestrationSupervisor → Sub Agents역할 분리 및 협업shared state, delegationResearch + Coding + QA agent
Reflection Agent자기 결과 비평Generate → Critique → Improve품질 향상retry loop코드 개선, hallucination 감소
Reflexion Agent실패 기억 기반 개선Attempt → Reflect → Retryself-improving agentmemory + retryautonomous debugging
Planning Agent계획 후 실행Planner → Steps → Executor긴 task 안정화planner noderesearch workflow
Human-in-the-loop사람 승인 삽입Agent → Approval → Continue안전성 확보interrupt/resumedeploy 승인
Tool-Augmented Agent외부 도구 적극 사용LLM ↔ Toolscapability 확장tool executorSQL/browser/python
Basic RAG Agentretrieval 기반 응답Retrieve → Generategroundingretriever node문서 QA
Corrective RAG (CRAG)retrieval 품질 검증Retrieve → Evaluate → Retry검색 품질 향상evaluator nodelow-quality retrieval 보정
Self-RAGretrieval 필요 여부 자가 판단Decide → Retrieve → Verify비용/정확도 최적화conditional graphadaptive QA
Adaptive RAG질문 난이도별 전략 변경Classify → Different RAG Flow동적 workflowrouting graphenterprise search
Tree Search Agent (LATS)여러 reasoning path 탐색Multi-path → Evaluate → SelectSystem 2 reasoningbranching graph복잡한 문제 해결
Stateful Workflow Agent상태 기반 workflow orchestrationNodes + Shared Statedurable workflowgraph statelong-running workflow
Validation Agent출력 검증Output → Validate → Approve안전성/정확성validation nodeschema validation
Security Agent보안 정책 검사Input → Policy Check → Executesafe executionguardrail nodeprompt injection 방어
Evaluation Agent결과 scoring/evalOutput → Judge → Score품질 평가evaluator graphLLM eval pipeline
Memory Agent장기/단기 기억 활용Retrieve Memory → Generatepersonalizationcheckpoint/storepersistent assistant
Collaborative Agentagent 간 peer collaborationAgent ↔ Agentcollective reasoningmessage passingdebate architecture
Autonomous Agent목표 기반 자율 반복 실행Goal → Plan → Execute → Retryautonomous workflowpersistent loopautonomous research
Event-Driven Agent이벤트 기반 실행Event → Trigger → Actionreactive systemasync nodemonitoring automation
Hierarchical Agent계층형 orchestrationManager → Worker → Specialistlarge-scale orchestrationnested graphenterprise AI workflow
Critic-Generator Pattern생성 + 평가 분리Generator → Critic → Revise품질 향상dual-node loopwriting/code review
Debate Agent다중 관점 토론Agent A ↔ Agent B → Judgereasoning robustnessmulti-branch graphdecision support
Verification Agent결과 검증 전용Solve → Verify → Finalizefactual correctnessverifier nodemath/code validation
Workflow DAG AgentDAG 기반 task executionDirected Task Graphdeterministic orchestrationDAG edgesETL + AI workflow
Long-running Durable Agentcheckpoint/recovery 지원Execute → Persist → Resume안정적 장기 실행checkpoint engineasync enterprise agent
Streaming Agentpartial output streamingNode → Stream UI실시간 UXstreaming stateassistant-ui 연동
UI-aware AgentUI state 직접 제어Agent → UI Actioninteractive UXUI message stateCopilot/assistant UI
Guardrailed Tool Agenttool execution 제한Policy → Tool Call안전한 tool 사용permission layer금융/사내 시스템