Textual Analysis

Textual Signals

What users type or say carries emotional weight. Nefesh accepts sentiment and urgency scores extracted from text, adding a linguistic dimension to the stress assessment.

Accepted Fields

FieldTypeRangeDescription
sentimentfloat-1.0 to 1.0Text sentiment score. -1.0 = very negative, 0 = neutral, 1.0 = very positive
urgencystringlow, medium, high, criticalUrgency classification from message content

How It Works

You run sentiment analysis on the user's text (using any NLP pipeline) and send the result. Nefesh uses this alongside biometric signals to understand context — for example, negative sentiment combined with elevated heart rate is a stronger stress indicator than either signal alone.

Trigger Memory Integration

For deeper textual analysis, send user_message and ai_response alongside your signals. Nefesh will automatically extract psychological topics and build a per-user trigger profile over time. See the API Reference for details.

Example Payload

{
  "session_id": "sess_abc123",
  "timestamp": "2026-03-30T14:30:00Z",
  "sentiment": -0.6,
  "urgency": "high",
  "heart_rate": 88,
  "user_message": "I can't handle this deadline anymore",
  "ai_response": "I understand that feels overwhelming. Let's break it down."
}

Note: sentiment is a float, not a string. Use a value between -1.0 and 1.0.