docs/docs/Develop/integrations-langsmith.mdx
LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, add your LangChain API key and configuration as Langflow environment variables, and then start Langflow.
Obtain your LangChain API key from https://smith.langchain.com
Set the following environment variables in your Langflow .env file, replacing LANGCHAIN_API_KEY and LANGSMITH_PROJECT_NAME with your own values:
LANGSMITH_TRACING=True
LANGSMITH_ENDPOINT=https://api.smith.langchain.com/
LANGSMITH_API_KEY=LANGCHAIN_API_KEY
LANGSMITH_PROJECT=LANGSMITH_PROJECT_NAME
Alternatively, you can export the environment variables in your terminal instead of adding them to the .env file:
export LANGSMITH_TRACING=True && export LANGSMITH_ENDPOINT="https://api.smith.langchain.com/" && export LANGSMITH_API_KEY="LANGCHAIN_API_KEY" && export LANGSMITH_PROJECT="LANGSMITH_PROJECT_NAME"
Restart Langflow with your modified .env file or from the terminal where you set your environment variables:
langflow run --env-file .env
If you set the environment variables in your terminal, you can omit --env-file.
However, Langflow can source environment variables from .env and your terminal.
For more information, see Langflow environment variables.
Run a flow in Langflow to generate some activity.
View the LangSmith dashboard for monitoring and observability.