Skip to main content
GET
https://api.tracelm.ai
/
api
/
v1
/
conversations
/
{id}
/
context-failures
Get Context Failures
curl --request GET \
  --url https://api.tracelm.ai/api/v1/conversations/{id}/context-failures
{
  "failures": [
    {}
  ],
  "summary": {}
}
Returns detailed information about context failures detected in a conversation.

Path Parameters

id
string
required
The conversation ID

Query Parameters

severity
string
Filter by severity: low, medium, high
type
string
Filter by failure type: forgotten_preference, repeated_question, contradicted_fact, violated_constraint, lost_context

Response

failures
array
Array of context failure objects:
  • id: Unique failure identifier
  • type: Type of context failure
  • severity: low, medium, or high
  • description: Human-readable description
  • trace_id: Associated trace ID
  • detected_at: When the failure was detected
summary
object
Summary of context failures:
  • total: Total number of failures
  • by_type: Count by failure type
  • by_severity: Count by severity level

Context Failure Types

TypeDescription
forgotten_preferenceUser preference from earlier in conversation was not respected
repeated_questionAgent asked a question the user already answered
contradicted_factAgent stated something that contradicts earlier information
violated_constraintAgent violated a constraint specified by the user
lost_contextAgent lost track of important context from the conversation

Example

curl -X GET "https://api.tracelm.ai/api/v1/conversations/conv_456/context-failures?severity=high" \
  -H "X-API-Key: $TRACELM_API_KEY"

Response

{
  "failures": [
    {
      "id": "cf_001",
      "type": "forgotten_preference",
      "severity": "high",
      "description": "User specified budget constraint of $500, but agent suggested options exceeding $800",
      "trace_id": "trace_12",
      "detected_at": "2024-01-15T10:35:00Z"
    },
    {
      "id": "cf_002",
      "type": "repeated_question",
      "severity": "medium",
      "description": "Agent asked for destination city again after user already specified 'New York'",
      "trace_id": "trace_8",
      "detected_at": "2024-01-15T10:20:00Z"
    }
  ],
  "summary": {
    "total": 2,
    "by_type": {
      "forgotten_preference": 1,
      "repeated_question": 1
    },
    "by_severity": {
      "high": 1,
      "medium": 1
    }
  }
}
High severity context failures often indicate significant issues with the agent’s ability to maintain state across turns. Consider reviewing your conversation context management.