Skip to content

GH-5654: fix: clear entire conversation history in RedisChatMemoryRepository#5655

Open
jbl428 wants to merge 1 commit intospring-projects:mainfrom
jbl428:fix/redis-chat-memory-delete
Open

GH-5654: fix: clear entire conversation history in RedisChatMemoryRepository#5655
jbl428 wants to merge 1 commit intospring-projects:mainfrom
jbl428:fix/redis-chat-memory-delete

Conversation

@jbl428
Copy link

@jbl428 jbl428 commented Mar 22, 2026

resolves #5654

- Delete conversation documents in repeated search batches using configured max messages size.
- Add integration test coverage for clearing conversations with more than ten messages.

Signed-off-by: Jake Son <sonjeabin@gmail.com>
@jbl428 jbl428 changed the title fix(redis-memory): clear entire conversation history GH-5654: fix: clear entire conversation history Mar 22, 2026
@jbl428 jbl428 changed the title GH-5654: fix: clear entire conversation history GH-5654: fix: clear entire conversation history in RedisChatMemoryRepository Mar 22, 2026
}

try (Pipeline pipeline = jedis.pipelined()) {
result.getDocuments().forEach(doc -> pipeline.del(doc.getId()));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to use UNLINK instead of DEL here for conversation cleanup?
It might reduce blocking during large deletes while keeping the same user-facing behavior.
If this sounds reasonable, I can either include it in this PR or open a separate issue for follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedisChatMemoryRepository clear() only deletes first 10 messages in a conversation

1 participant