Skip to content

@voltagent/server-core@2.1.11

Choose a tag to compare

@voltagent-bot voltagent-bot released this 01 Apr 17:46
· 7 commits to main since this release
3776cb6

Patch Changes

  • #1183 b48f107 Thanks @omeraplak! - feat: persist selected assistant message metadata to memory

    You can enable persisted assistant message metadata at the agent level or per request.

    const result = await agent.streamText("Hello", {
      memory: {
        userId: "user-1",
        conversationId: "conv-1",
        options: {
          messageMetadataPersistence: {
            usage: true,
            finishReason: true,
          },
        },
      },
    });

    With this enabled, fetching messages from memory returns assistant UIMessage.metadata
    with fields like usage and finishReason, not just stream-time metadata.

    REST API requests can enable the same behavior with options.memory.options:

    curl -X POST http://localhost:3141/agents/assistant/text \
      -H "Content-Type: application/json" \
      -d '{
        "input": "Hello",
        "options": {
          "memory": {
            "userId": "user-1",
            "conversationId": "conv-1",
            "options": {
              "messageMetadataPersistence": {
                "usage": true,
                "finishReason": true
              }
            }
          }
        }
      }'
  • Updated dependencies [b48f107, 195155b]:

    • @voltagent/core@2.6.14