이 빠른 시작 가이드는 테스트 및 개발을 위해 LangGraph 애플리케이션을 로컬에서 설정하는 방법을 보여줍니다.

사전 요구 사항

시작하기 전에 LangSmith의 API key가 있는지 확인하세요 (무료 가입 가능).

1. LangGraph CLI 설치하기

  • Python server
  • Node server
# Python >= 3.11 is required.

pip install -U "langgraph-cli[inmem]"

2. LangGraph 앱 생성하기 🌱

new-langgraph-project-python template 또는 new-langgraph-project-js template에서 새 앱을 생성하세요. 이 template은 자신의 로직으로 확장할 수 있는 단일 노드 애플리케이션을 보여줍니다.
  • Python server
  • Node server
langgraph new path/to/your/app --template new-langgraph-project-python
추가 template
template을 지정하지 않고 langgraph new를 사용하면 사용 가능한 template 목록에서 선택할 수 있는 대화형 메뉴가 표시됩니다.

3. 의존성 설치하기

새 LangGraph 앱의 루트에서 로컬 변경 사항이 서버에서 사용되도록 edit 모드로 의존성을 설치하세요:
  • Python server
  • Node server
cd path/to/your/app
pip install -e .

4. .env 파일 생성하기

새 LangGraph 앱의 루트에서 .env.example을 찾을 수 있습니다. 새 LangGraph 앱의 루트에 .env 파일을 생성하고 .env.example 파일의 내용을 복사하여 필요한 API key를 입력하세요:
LANGSMITH_API_KEY=lsv2...

5. LangGraph Server 실행하기 🚀

LangGraph API server를 로컬에서 시작하세요:
  • Python server
  • Node server
langgraph dev
샘플 출력:
>    Ready!
>
>    - API: [http://localhost:2024](http://localhost:2024/)
>
>    - Docs: http://localhost:2024/docs
>
>    - Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
langgraph dev 명령은 인메모리 모드로 LangGraph Server를 시작합니다. 이 모드는 개발 및 테스트 목적에 적합합니다.
프로덕션 사용을 위해서는 영구 스토리지 백엔드와 함께 LangGraph Server를 배포하세요. 자세한 내용은 LangSmith 호스팅 옵션을 참조하세요.

6. API 테스트하기

  • Python SDK (async)
  • Python SDK (sync)
  • Javascript SDK
  • Rest API
  1. LangGraph Python SDK를 설치하세요:
pip install langgraph-sdk
  1. assistant에게 메시지를 보내세요 (threadless run):
from langgraph_sdk import get_client
import asyncio

client = get_client(url="http://localhost:2024")

async def main():
    async for chunk in client.runs.stream(
        None,  # Threadless run
        "agent", # Name of assistant. Defined in langgraph.json.
        input={
        "messages": [{
            "role": "human",
            "content": "What is LangGraph?",
            }],
        },
    ):
        print(f"Receiving new event of type: {chunk.event}...")
        print(chunk.data)
        print("\n\n")

asyncio.run(main())

다음 단계

이제 LangGraph 앱이 로컬에서 실행되고 있으므로 배포할 준비가 되었습니다: LangSmith의 호스팅 옵션을 선택하세요:
  • Cloud: 가장 빠른 설정, 완전 관리형 (권장).
  • Hybrid: 은 사용자의 클라우드에, 은 LangChain에서 관리.
  • Self-hosted: 사용자의 인프라에서 완전한 제어.
자세한 내용은 호스팅 비교를 참조하세요. 그런 다음 앱을 배포하세요: 기능 살펴보기:
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I