Skip to content

Only send *new messages* to agent (since previous messages have already been persisted. #377

@nicksrandall

Description

@nicksrandall

Since messages are persisted to the DO, I don't think it makes sense to send all messages in every request. I think it would be better to just send new messages and then reconstruct the history of messages from the messages already in the DO's database.

Here is an example on how this can be accomplished with AI SDK: https://ai-sdk.dev/cookbook/next/send-custom-body-from-use-chat

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions