Ai knowledge and logicHelpers

get_conversation_notes

Read the internal notes already on the conversation.

get_conversation_notes(context: dict) -> list

Returns every internal note on the conversation, newest first.


Parameters

NameTypeDescription
contextdictThe context object passed to your action

Returns

list of dict, each with:

FieldTypeDescription
idstrNote ID
textstrNote body
createdAtstrISO 8601 timestamp
authorTypestruser, api, or automation
authorNamestrThe agent's name for user notes, otherwise a label from authorType

Returns an empty list in test/mock environments.


Examples

Avoid writing the same note twice

def handle_event(context):
    notes = get_conversation_notes(context)
    if any("Escalated to the web team" in note["text"] for note in notes):
        return {"skipped": "already escalated"}

    add_conversation_note(context, "Escalated to the web team.")

Give the AI what agents already wrote

def execute_action(context):
    notes = get_conversation_notes(context)
    agent_notes = [n["text"] for n in notes if n["authorType"] == "user"]

    return {"internal_context": agent_notes[:5]}

On this page