Skip to content

Provide a way to intercept and store chat historyย #2068

@chirino

Description

@chirino

It would be nice if we could annotate the @RegisterAiService class methods with something like @StoreHistory annotation.

I ended building something like that in: https://github.com/chirino/memory-service?tab=readme-ov-file#5-conversation-history-recording using the @RecordConversation, but I think you guys could do an even better job.

Now the tricky part might be designing a good pluggable SPI. A simple approach might be to just call some store interface with the user message and then again with the final agent response. But my store also wants to make in flight streaming responses resumable/cancelable so it needs to wrap the stream response too. Oh and we need a way to make sure the user identity is propagated to those store interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions