LangSmith Integration
LangSmith is LangChain's platform for debugging, testing, and monitoring LLM applications.
Overview
The LangSmith integration enables LangGuard to:
- Import runs from LangSmith projects
- Track chains and agents from LangChain applications
- Monitor evaluations and feedback
- Apply governance policies to LangChain traces
Prerequisites
- A LangSmith account
- API key from LangSmith
- Active project with runs
Getting Your API Key
- Log in to LangSmith
- Navigate to Settings
- Go to API Keys
- Click Create API Key
- Copy the key (format:
lsv2_pt_...)
Setup
Step 1: Add Integration
- Navigate to Settings > Integrations in LangGuard
- Click Add Integration
- Select LangSmith
Step 2: Configure Credentials
| Field | Description | Required |
|---|---|---|
| Name | Friendly name | Yes |
| API Key | LangSmith API key | Yes |
| Host URL | API endpoint | No (defaults to cloud) |
Step 3: Test and Save
- Click Test Connection
- Verify success
- Click Save
Configuration
Environment Variables
LANGSMITH_API_KEY=lsv2_pt_your-key-here
LANGSMITH_HOST=https://api.smith.langchain.com
What Gets Synced
Runs
LangSmith runs become LangGuard traces:
| LangSmith Field | LangGuard Field |
|---|---|
id | externalId |
name | name |
start_time | timestamp |
total_time | duration |
inputs | input |
outputs | output |
extra | metadata |
Run Types
- Chain runs
- LLM calls
- Tool calls
- Retriever operations
Troubleshooting
Invalid API Key
- Verify key starts with
lsv2_pt_ - Check key hasn't been revoked
- Generate a new key if needed
No Runs Found
- Verify runs exist in LangSmith
- Check time range settings
- Ensure correct project is selected
Next Steps
- Quick Start - Start exploring traces
- Policies - Apply governance rules