Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1778861096-fe7dc74.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

LangSmith Deployment runs any framework. For agents not built on Deep Agents, LangChain, or LangGraph, wrap your existing agent with the LangGraph Functional API and deploy it the same way you would deploy a LangGraph application.
For new builds, consider Deep Agents, an open-source harness for agents that plan, use tools, delegate to subagents, and work over long horizons. Deep Agents deploy directly to LangSmith Deployment, with Managed Deep Agents available for a fully hosted runtime.

Supported frameworks

The Functional API works with any Python or JavaScript agent. The following frameworks have examples in the deployment walkthrough:
Don’t see your framework? The Functional API accepts any callable, so you can apply the same pattern shown in the following examples to any agent library. Wrap your agent’s entrypoint with @task and @entrypoint, then deploy.

Why the Functional API?

The Functional API lets you integrate and deploy agents built with frameworks other than LangChain. Deploying to LangSmith provides: It uses two key building blocks:
  • @entrypoint: Marks a function as the starting point of a workflow, encapsulating logic and managing execution flow, including handling long-running tasks and interrupts.
  • @task: Represents a discrete unit of work, such as an API call or data processing step, that can be executed asynchronously within an entrypoint. Tasks return a future-like object that can be awaited or resolved synchronously.

General deployment pattern

Regardless of framework, follow the same steps. Choose your stack in the tabs inside each step and combine the snippets in one module (for example agent.py). Other frameworks follow the same pattern.
1

Set up prerequisites

Install Python dependencies and configure credentials for your provider.
For Claude Agent SDK install:
  • Python 3.10+
  • Dependencies: pip install claude-agent-sdk langgraph langsmith
  • ANTHROPIC_API_KEY set in your environment
2

Define your agent

Build your agent using the framework of your choice, exactly as you would outside of LangSmith.
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient

options = ClaudeAgentOptions(
    model="claude-sonnet-4-5-20250929",
    system_prompt="You are a helpful assistant.",
)
3

Wrap with the Functional API

Expose your agent through an @entrypoint-decorated function. Inside, use @task for the unit of work that calls into the framework.
import operator

from claude_agent_sdk import ClaudeSDKClient
from langgraph.func import entrypoint, task

@task
async def invoke_claude(prompt: str) -> str:
    async with ClaudeSDKClient(options=options) as client:
        await client.query(prompt)
        chunks: list[str] = []
        async for message in client.receive_response():
            chunks.append(str(message))
        return "\n".join(chunks)

@entrypoint()
async def workflow(messages: list[dict], previous: list[dict]):
    history = operator.add(previous or [], messages)
    prompt = history[-1]["content"]
    response = await invoke_claude(prompt)
    new_message = {"role": "assistant", "content": response}
    return entrypoint.final(
        value=[new_message],
        save=operator.add(history, [new_message]),
    )
4

Configure tracing

Forward the framework’s native traces to LangSmith. Most frameworks emit OpenTelemetry, which LangSmith ingests directly.
Use the LangSmith Claude Agent SDK integration to forward traces:
from langsmith.integrations.claude_agent_sdk import configure_claude_agent_sdk

configure_claude_agent_sdk()
For full setup details, see Trace Claude Agent SDK applications.
5

Deploy

Add a langgraph.json file pointing at your entrypoint. Use a layout like the following:
my-agent/
├── agent.py          # Your entrypoint code
├── requirements.txt  # Python dependencies
└── langgraph.json    # LangGraph configuration
Then follow Deploy to cloud or Deploy standalone.