Skip to main content
LangSmith stores every trace from your agents so you can replay, debug, and share runs — PraisonAI delivers them live over LangSmith’s Runs API.

Quick Start

1

Simple Usage

2

With Configuration


How It Works

Spans are posted to LangSmith as runs, asynchronously, while your agent keeps working.

Configuration Options

Secrets are read from the environment only and never logged; programmatic values override the env.
When self-hosting over http://, use localhost, 127.0.0.1, or ::1 — the adapter refuses non-loopback plaintext endpoints so the API key cannot leak on the wire.

When does delivery happen?

Spans are posted asynchronously; your agent’s hot path never waits for LangSmith. Call await obs.flush() before the process exits (e.g. in a serverless handler) to drain the queue. If a request fails, flush() warns how many runs did not reach LangSmith — the key, endpoint and network are not silently swallowed.

Common Patterns

Multiple agents sharing one trace keep their tree in LangSmith via parent_run_id.
Self-hosted LangSmith is one env var away.
Missing key degrades gracefully: spans record to memory and flush() warns nothing was delivered.

Best Practices

Prefer the environment variable over the programmatic apiKey so the key stays out of source control. The env key is read on initialize().
Delivery is async. In short-lived processes (scripts, serverless handlers) call await obs.flush() so queued runs reach LangSmith before the process ends.
The API key travels as x-api-key. Plaintext http:// is refused for non-loopback hosts; use https:// unless the endpoint is localhost.
Set a different LANGSMITH_PROJECT for dev, staging, and prod so traces land in separate LangSmith sessions.

LangSmith CLI

CLI commands

Observability

Overview and delivery matrix