@langchain/langsmith-pi-extension extension.
Once configured, each Pi session sends traces to LangSmith. Each trace includes user messages, assistant responses, tool calls, and individual LLM invocations, which gives you full observability into your Pi coding agent runs.
This integration uses a legacy destination setting such as
project_name or LANGSMITH_PROJECT. Create an agent, choose its environment, and retrieve that environment’s tracer_session_name. Use that returned value in the destination setting and any overrides. For integrations that support agent addressing, use the agent identifier and environment directly.Prerequisites
Before setting up tracing, ensure you have:- Pi installed.
- A LangSmith API key.
Installation
Install the extension via Pi:Quick start
Tracing is disabled by default. Set the following environment variables to enable tracing and connect to your LangSmith account:LANGSMITH_PI_PROJECT to the selected agent environment’s tracer_session_name before sending traces.
Configuration
Configuration can come from environment variables or JSON config files. Values are merged in the following order, with later sources taking precedence:- Defaults
~/.pi/langsmith.json(global config)<current-working-directory>/.pi/langsmith.json(project config)- Environment variables
Environment variables
Example:
Config file
Create~/.pi/langsmith.json for global settings or .pi/langsmith.json in a project directory for local overrides:
Replicas
Usereplicas to send traces to multiple LangSmith destinations simultaneously. This is useful for forwarding traces to both a personal workspace and a shared team workspace, or to a self-hosted LangSmith instance alongside the cloud.
updates object to override metadata or tags on the replicated runs.
Connect these docs to your agent of choice via MCP for real-time answers.

