Production & LangSmith
Shipping LangChain apps needs observability, evals, security, and deployment. LangSmith is the official tracing and evaluation platform.
LangSmith
- Tracing: LLM calls, tools, latency, tokens per run
- Datasets & evals: regression suites, automated scoring
- Monitoring: production anomaly detection (Engine evolves over time)
Site: smith.langchain.com
Enable tracing
Often zero code changes. Inspect full message traces and tool I/O in the UI.
Evaluations
- Create a dataset (inputs + reference outputs)
- Batch-run your agent
- Score with LLM-as-judge or rules
For RAG: faithfulness, answer relevance, context precision.
Dev vs prod
Security
Prompt injection via tool outputs, least-privilege tools, PII middleware, step/model cost controls.
Deployment
- Self-hosted FastAPI + Postgres checkpointer
- LangGraph Platform (managed)
- Queue workers for long jobs
Pin dependencies
Run smoke tests and LangSmith eval gates in CI.