Skip to main content
LangSmith makes it easy to attach feedback to traces. This feedback can come from users, annotators, automated evaluators, and so on, which is crucial for monitoring and evaluating agents. This page details how to log feedback using the SDK. For the structure of feedback objects, refer to Feedback data format.
In an agent-based workspace, create an agent once before sending traces. Use agent addressing to select its identifier and environment. If an integration requires project_name, use the selected environment’s tracer_session_name as a compatibility value.

Use create_feedback() / createFeedback

Child runs You can attach user feedback to any child run of a trace, not just the trace (root run) itself. This is useful for critiquing specific steps of the agent, such as the retrieval step or generation step of a RAG pipeline.
Non-blocking creation (Python only) The Python client will automatically background feedback creation if you pass trace_id= to create_feedback(). This is essential for low-latency environments, where you want to make sure your agent isn’t blocked on feedback creation.
The following example creates a trace with two child runs, then logs feedback against the root run and against one of the child runs. The TypeScript snippet shows the equivalent createFeedback call shape, assuming a runId is already available from your agent.
For project-based traces, use readProject with the existing project name to get its ID instead of resolving an agent address. For resolution requirements, see Resolve an agent environment. You can even log feedback for in-progress runs using create_feedback() / createFeedback. See Access the current run (span) within a traced function for how to get the run ID of an in-progress run.

Collect feedback from a user interface

If you need to collect feedback from a browser or other client-side environment without exposing your API key, use presigned feedback tokens. These generate a URL scoped to a specific run and feedback key that clients can call directly. See Collect feedback with presigned URLs for the full guide. To learn more about how to filter traces based on various attributes, including user feedback, see Filter traces.