Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

🚀Share how you're building agents for a chance to win LangChain swag!

LangChain
LangGraph
Deep Agents
Integrations
Learn
Reference
Contribute
    Deploy with LangSmith

    LangChain overview

    LangChain v1.x is now available!For a complete list of changes and instructions on how to upgrade your code, see therelease notes andmigration guide.If you encounter any issues or have feedback, pleaseopen an issue so we can improve. To view v0.x documentation,go to the archived content.
    LangChain is the easiest way to start building agents and applications powered by LLMs. With under 10 lines of code, you can connect to OpenAI, Anthropic, Google, andmore. LangChain provides a pre-built agent architecture and model integrations to help you get started quickly and seamlessly incorporate LLMs into your agents and applications.We recommend you use LangChain if you want to quickly build agents and autonomous applications. UseLangGraph, our low-level agent orchestration framework and runtime, when you have more advanced needs that require a combination of deterministic and agentic workflows, heavy customization, and carefully controlled latency.LangChainagents are built on top of LangGraph in order to provide durable execution, streaming, human-in-the-loop, persistence, and more. You do not need to know LangGraph for basic LangChain agent usage.

    Install

    pip install -U langchain# Requires Python 3.10+

    Create an agent

    # pip install -qU "langchain[anthropic]" to call the modelfrom langchain.agentsimport create_agentdef get_weather(city:str) ->str:    """Get weather for a given city."""    return f"It's always sunny in{city}!"agent= create_agent(    model="claude-sonnet-4-5-20250929",    tools=[get_weather],    system_prompt="You are a helpful assistant",)# Run the agentagent.invoke(    {"messages": [{"role":"user","content":"what is the weather in sf"}]})

    Core benefits

    Standard model interface

    Different providers have unique APIs for interacting with models, including the format of responses. LangChain standardizes how you interact with models so that you can seamlessly swap providers and avoid lock-in.

    Easy to use, highly flexible agent

    LangChain’s agent abstraction is designed to be easy to get started with, letting you build a simple agent in under 10 lines of code. But it also provides enough flexibility to allow you to do all the context engineering your heart desires.

    Built on top of LangGraph

    LangChain’s agents are built on top of LangGraph. This allows us to take advantage of LangGraph’s durable execution, human-in-the-loop support, persistence, and more.

    Debug with LangSmith

    Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.

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

    Was this page helpful?

    ⌘I

    [8]ページ先頭

    ©2009-2025 Movatter.jp