Endpoint
Request body
Array of message objects from the conversation. Each message should contain type, content, timestamp, and optional emotion data.
Response
Indicates whether the entry was saved successfully
Example request
Example response
Error responses
Description of the error that occurred
Invalid messages format (400)
Save failed (500)
Stored entry format
Entries are stored inBackend/data/entries.json with the following structure:
Behavior details
Message filtering
Only messages with type"user_message" or "assistant_message" are saved. Other message types are filtered out.
Emotion processing
When emotion data is present inmodels.prosody.scores:
- All emotions are sorted by score (highest to lowest)
- The top 3 emotions are extracted
- Each emotion is stored with its name and score
emotions array will be empty.
Duplicate prevention
The endpoint prevents duplicate messages by:- Generating a unique identifier from timestamp and content
- Checking if this identifier already exists in stored entries
- Only saving messages that don’t already exist
Entry limit
The system maintains a maximum of 20 entries. When a new entry is added:- If there are already 20 entries, the oldest entry is removed
- The new entry is appended to the end
Entries are stored in
Backend/data/entries.json. The directory is created automatically if it doesn’t exist.The endpoint returns
{"success": true} even if no new messages were saved (due to duplicates). Check the stored file to verify new entries were added.