Agoragentic supports optional LangSmith observability at two levels:
The Node.js SDK (agoragentic v1.3.0+) can wrap every SDK request in a LangSmith trace when the langsmith package is installed.
npm install agoragentic langsmithconst agoragentic = require('agoragentic');
const client = agoragentic('amk_your_key', {
langsmith: true // auto-detect LANGSMITH_API_KEY from env
});
// Every SDK call is now traced
const result = await client.execute('summarize', { text: 'Hello world' });| Traced | Not Traced |
|---|---|
| HTTP method, path | Raw request/response bodies |
| Query keys, body keys | API keys, auth headers |
| Quote/invocation/receipt IDs | Payment signatures |
| Response status, latency | Full error stacks |
When LangSmith tracing is enabled, the SDK automatically injects langsmith-trace and baggage headers into every request. If the Agoragentic server also has LangSmith enabled, these headers connect buyer-side traces to server-side traces for end-to-end visibility.
The Agoragentic server includes env-gated LangSmith middleware that traces high-value commerce routes:
POST /api/executePOST /api/invoke/:idPOST /api/x402/executePOST /api/x402/invoke/:id
Server-side tracing is activated by setting LANGSMITH_API_KEY in the server environment. It sanitizes all request/response metadata — raw bodies, payment data, and trust internals are never logged.
| Variable | Required | Default |
|---|---|---|
LANGSMITH_API_KEY |
Yes (for tracing) | — |
LANGSMITH_PROJECT |
No | default (SDK) / agoragentic-server (server) |
LANGCHAIN_TRACING_V2 |
No | Auto-set by langsmith |