How to beginner · 3 min read

LangSmith team collaboration features

Quick answer
LangSmith enables team collaboration through shared projects, role-based access controls, and trace sharing, allowing multiple users to view, edit, and analyze AI model interactions together. It supports centralized logging and annotation of AI calls to improve team productivity and debugging.

PREREQUISITES

  • Python 3.8+
  • LangSmith API key
  • pip install langsmith

Setup

Install the langsmith Python package and set your API key as an environment variable to start using LangSmith's collaboration features.

bash
pip install langsmith

Step by step

This example demonstrates creating a shared project, inviting team members with roles, and logging traces collaboratively using the langsmith SDK.

python
import os
from langsmith import Client

# Initialize LangSmith client with API key from environment
client = Client(api_key=os.environ["LANGSMITH_API_KEY"])

# Create or get a shared project
project = client.create_project(name="AI Team Project")

# Invite team members with roles
# Roles can be: 'admin', 'editor', 'viewer'
client.invite_user(project_id=project.id, email="alice@example.com", role="editor")
client.invite_user(project_id=project.id, email="bob@example.com", role="viewer")

# Log a trace collaboratively
trace = client.create_trace(project_id=project.id, name="Model Inference Trace")
trace.log_event("User query", data={"query": "What is LangSmith?"})
trace.log_event("Model response", data={"response": "LangSmith enables AI observability and collaboration."})

print(f"Project '{project.name}' created with ID: {project.id}")
print(f"Trace logged with ID: {trace.id}")
output
Project 'AI Team Project' created with ID: proj_1234567890
Trace logged with ID: trace_0987654321

Common variations

You can manage team collaboration asynchronously or integrate LangSmith with LangChain for automatic trace logging. Use role-based access to control permissions and share traces via URLs for external review.

python
import asyncio
from langsmith import Client

async def async_collaboration():
    client = Client(api_key=os.environ["LANGSMITH_API_KEY"])
    project = await client.create_project(name="Async AI Project")
    await client.invite_user(project_id=project.id, email="carol@example.com", role="admin")
    trace = await client.create_trace(project_id=project.id, name="Async Trace")
    await trace.log_event("Async event", data={"info": "Async collaboration example"})
    print(f"Async project and trace created with IDs: {project.id}, {trace.id}")

asyncio.run(async_collaboration())
output
Async project and trace created with IDs: proj_abcdef1234, trace_zyxwv9876

Troubleshooting

  • If you see permission errors, verify that the invited users have accepted their invitations and have the correct roles assigned.
  • Ensure your LANGSMITH_API_KEY environment variable is set correctly to avoid authentication failures.
  • For trace sharing issues, confirm that the project and trace are marked as shared or public as per your organization's settings.

Key Takeaways

  • Use LangSmith projects to centralize AI model trace logging for your team.
  • Assign role-based access to control collaboration permissions effectively.
  • Share traces and projects to enable transparent team debugging and analysis.
Verified 2026-04
Verify ↗