Skip to main content
LangChain v1.0을 사용할 수 있습니다!전체 변경 사항 목록과 코드 업그레이드 방법에 대해서는 릴리스 노트마이그레이션 가이드를 참조하세요.문제가 발생하거나 피드백이 있으시면 이슈를 등록해 주시면 개선하겠습니다. v0.x 문서를 보려면 보관된 사이트로 이동하세요.
LangChain은 LLM 기반 에이전트와 애플리케이션을 구축하는 가장 쉬운 방법입니다. 10줄 미만의 코드로 OpenAI, Anthropic, Google 및 그 외 여러 제공업체에 연결할 수 있습니다. LangChain은 사전 구축된 에이전트 아키텍처와 모델 통합을 제공하여 빠르게 시작하고 LLM을 에이전트 및 애플리케이션에 원활하게 통합할 수 있도록 지원합니다. 에이전트와 자율 애플리케이션을 빠르게 구축하려면 LangChain을 사용하는 것이 좋습니다. 결정론적 워크플로와 에이전틱 워크플로의 조합, 광범위한 커스터마이징, 정밀한 지연 시간 제어가 필요한 고급 요구사항이 있는 경우에는 저수준 에이전트 오케스트레이션 프레임워크이자 런타임인 LangGraph를 사용하세요. LangChain 에이전트는 지속 가능한 실행, 스트리밍, 사람 개입(human-in-the-loop), 영속성 등을 제공하기 위해 LangGraph 위에 구축되었습니다. 기본적인 LangChain 에이전트를 사용하기 위해 LangGraph를 알 필요는 없습니다.

설치

npm install langchain @langchain/core

에이전트 생성

import * as z from "zod";
// npm install @langchain/anthropic to call the model
import { createAgent, tool } from "langchain";

const getWeather = tool(
  ({ city }) => `It's always sunny in ${city}!`,
  {
    name: "get_weather",
    description: "Get the weather for a given city",
    schema: z.object({
      city: z.string(),
    }),
  },
);

const agent = createAgent({
  model: "anthropic:claude-sonnet-4-5",
  tools: [getWeather],
});

console.log(
  await agent.invoke({
    messages: [{ role: "user", content: "What's the weather in Tokyo?" }],
  })
);

핵심 이점


Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I