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.
Set up prerequisites
Install Python dependencies and configure credentials for your provider. Claude Agent SDK
Strands Agents
CrewAI
AutoGen
Google ADK
For Claude Agent SDK install:
- Python 3.10+
- Dependencies:
pip install claude-agent-sdk langgraph langsmith
ANTHROPIC_API_KEY set in your environment
For Strands Agents install:
- Python 3.9+
- Dependencies:
pip install strands-agents strands-agents-tools langgraph "langsmith[strands-agents]"
- AWS credentials in your environment
For CrewAI install:
- Python 3.10+
- Dependencies:
pip install crewai langgraph langsmith opentelemetry-instrumentation-crewai opentelemetry-instrumentation-openai
- LLM provider credentials in your environment (for example
OPENAI_API_KEY if you use OpenAI-backed models)
For AutoGen install:
- Python 3.10+
- Dependencies:
pip install autogen-agentchat autogen-ext langgraph langsmith opentelemetry-instrumentation-openai
OPENAI_API_KEY (or your model provider credentials) set in your environment
For Google Agent Development Kit install:
- Python 3.10+
- Dependencies:
pip install langgraph langsmith[google-adk]
- Google Generative AI credentials in your environment (see Trace Google ADK applications for API key setup)
Define your agent
Build your agent using the framework of your choice, exactly as you would outside of LangSmith. Claude Agent SDK
Strands Agents
CrewAI
AutoGen
Google ADK
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient
options = ClaudeAgentOptions(
model="claude-sonnet-4-5-20250929",
system_prompt="You are a helpful assistant.",
)
from strands import Agent
from strands_tools import file_read, file_write, journal, python_repl, shell
agent = Agent(
tools=[file_read, file_write, python_repl, shell, journal],
system_prompt="You are an Expert Software Developer Assistant specializing in web frameworks. Your task is to analyze project structures and identify mappings.",
model="us.anthropic.claude-sonnet-4-20250514-v1:0",
)
from crewai import Agent, Crew, Task
researcher = Agent(role="Researcher", goal="Research a topic", backstory="Expert researcher.")
crew = Crew(
agents=[researcher],
tasks=[Task(description="{topic}", agent=researcher, expected_output="A short report.")],
)
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
assistant = AssistantAgent(
name="assistant",
model_client=OpenAIChatCompletionClient(model="gpt-4o"),
)
from google.adk.agents import Agent
from google.adk.runners import InMemoryRunner
adk_agent = Agent(name="assistant", model="gemini-2.0-flash", instruction="You are a helpful assistant.")
runner = InMemoryRunner(agent=adk_agent, app_name="my-app")
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. Claude Agent SDK
Strands Agents
CrewAI
AutoGen
Google ADK
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]),
)
import operator
from langgraph.func import entrypoint, task
from strands.types.content import Message
@task
def invoke_strands(messages: list[Message]):
result = agent(messages)
return [result.message]
@entrypoint()
def workflow(messages: list[Message], previous: list[Message]):
messages = operator.add(previous or [], messages)
response = invoke_strands(messages).result()
return entrypoint.final(value=response, save=operator.add(messages, response))
import operator
from langgraph.func import entrypoint, task
@task
def run_crew(topic: str) -> str:
return str(crew.kickoff(inputs={"topic": topic}))
@entrypoint()
def workflow(messages: list[dict], previous: list[dict]):
history = operator.add(previous or [], messages)
response = run_crew(history[-1]["content"]).result()
new_message = {"role": "assistant", "content": response}
return entrypoint.final(value=[new_message], save=operator.add(history, [new_message]))
import operator
from langgraph.func import entrypoint, task
@task
async def invoke_autogen(prompt: str) -> str:
result = await assistant.run(task=prompt)
return result.messages[-1].content
@entrypoint()
async def workflow(messages: list[dict], previous: list[dict]):
history = operator.add(previous or [], messages)
response = await invoke_autogen(history[-1]["content"])
new_message = {"role": "assistant", "content": response}
return entrypoint.final(value=[new_message], save=operator.add(history, [new_message]))
import operator
from google.genai import types
from langgraph.func import entrypoint, task
@task
async def invoke_adk(prompt: str) -> str:
session = await runner.session_service.create_session(app_name="my-app", user_id="user")
content = types.Content(role="user", parts=[types.Part.from_text(text=prompt)])
response = ""
async for event in runner.run_async(user_id="user", session_id=session.id, new_message=content):
if event.is_final_response() and event.content:
response = event.content.parts[0].text
return response
@entrypoint()
async def workflow(messages: list[dict], previous: list[dict]):
history = operator.add(previous or [], messages)
response = await invoke_adk(history[-1]["content"])
new_message = {"role": "assistant", "content": response}
return entrypoint.final(value=[new_message], save=operator.add(history, [new_message]))
Configure tracing
Forward the framework’s native traces to LangSmith. Most frameworks emit OpenTelemetry, which LangSmith ingests directly. Claude Agent SDK
Strands Agents
CrewAI
AutoGen
Google ADK
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. Use the LangSmith Strands Agents integration to forward traces. Set your LangSmith API key and project name. If you use Amazon Bedrock as the model provider, also configure AWS credentials with your preferred AWS authentication method.export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.smith.langchain.com/otel/v1/traces
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your_langsmith_api_key>,Langsmith-Project=<your_project_name>"
# Required when using Amazon Bedrock.
export AWS_REGION=<your_aws_region>
Strands’ OTel tracing contains synchronous code. In this case, you may need to set BG_JOB_ISOLATED_LOOPS=true to execute background runs in an isolated event loop separate from the serving API event loop. This only prevents health-check failures; the synchronous tracing code still degrades throughput and tail latency under load. See BG_JOB_ISOLATED_LOOPS for recommended async alternatives. Call setup_langsmith_telemetry() once at application startup before creating or invoking agents:from langsmith.integrations.strands_agents import setup_langsmith_telemetry
setup_langsmith_telemetry()
For full setup details, see Trace Strands Agents applications. Use OpenTelemetry to forward CrewAI traces to LangSmith. Set your API keys and project name:export LANGSMITH_API_KEY=<your_langsmith_api_key>
export LANGSMITH_PROJECT=<your_project_name>
export OPENAI_API_KEY=<your_openai_api_key>
Register the LangSmith span processor with the CrewAI and OpenAI instrumentors:from langsmith.integrations.otel import OtelSpanProcessor
from opentelemetry import trace
from opentelemetry.instrumentation.crewai import CrewAIInstrumentor
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
from opentelemetry.sdk.trace import TracerProvider
# Get or create tracer provider
current_provider = trace.get_tracer_provider()
if isinstance(current_provider, TracerProvider):
tracer_provider = current_provider
else:
tracer_provider = TracerProvider()
trace.set_tracer_provider(tracer_provider)
# Add OtelSpanProcessor to the tracer provider
tracer_provider.add_span_processor(OtelSpanProcessor())
# Instrument CrewAI and OpenAI
CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
For full setup details, see Trace CrewAI applications. Use OpenTelemetry to forward AutoGen traces to LangSmith. Set your API keys and project name:export LANGSMITH_API_KEY=<your_langsmith_api_key>
export LANGSMITH_PROJECT=<your_project_name>
export OPENAI_API_KEY=<your_openai_api_key>
Register the LangSmith span processor with the OpenAI instrumentor:from langsmith.integrations.otel import OtelSpanProcessor
from opentelemetry import trace
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
from opentelemetry.sdk.trace import TracerProvider
# Set up tracer provider
tracer_provider = TracerProvider()
tracer_provider.add_span_processor(OtelSpanProcessor())
trace.set_tracer_provider(tracer_provider)
# Instrument OpenAI calls
OpenAIInstrumentor().instrument()
For full setup details, see Trace AutoGen applications. Use the LangSmith Google ADK integration to forward traces:from langsmith.integrations.google_adk import configure_google_adk
configure_google_adk(
project_name="my-adk-project", # Optional: defaults to LANGSMITH_PROJECT env var
)
For full setup details, see Trace Google ADK applications. 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.