-
Notifications
You must be signed in to change notification settings - Fork 1.4k
WIP - Redis/semantic caching advisor and chat memory #2982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
markpollack
wants to merge
2
commits into
main
Choose a base branch
from
redis/semantic-caching-advisor-and-chat-memory
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ntations Add comprehensive Redis-backed features to enhance Spring AI: * Add semantic caching for chat responses: - SemanticCache interface and Redis implementation using vector similarity - SemanticCacheAdvisor for intercepting and caching chat responses - Uses vector search to cache and retrieve responses based on query similarity - Support for TTL-based cache expiration - Improves response times and reduces API costs for similar questions * Add Redis-based chat memory implementation: - RedisChatMemory using RedisJSON + RediSearch for conversation storage - Configurable RedisChatMemoryConfig with builder pattern support - Message TTL, ordering, multi-conversation and batch operations - Efficient conversation history retrieval using RediSearch indexes * Add integration tests: - Comprehensive test coverage using TestContainers - Tests for semantic caching features and chat memory operations - Integration test for RedisVectorStore with VectorStoreChatMemoryAdvisor - Verify chat completion augmentation with vector store content The Redis implementations enable efficient storage and retrieval of chat responses and conversation history, with semantic search capabilities and configurable persistence options. Signed-off-by: Brian Sam-Bodden <[email protected]>
not sure why the semantic cache IT doesn't connect to redis. |
bsbodden
added a commit
to bsbodden/spring-ai
that referenced
this pull request
May 4, 2025
…nectivity Refactor Redis-based chat memory implementation to: - Implement ChatMemoryRepository interface as requested in PR spring-projects#2295 - Fix Redis connection issues in integration tests reported in PR spring-projects#2982 - Optimize conversation ID lookup with server-side deduplication - Add configurable result limits to avoid Redis cursor size limitations - Implement robust fallback mechanism for query failures - Enhance support for metadata, toolcalls, and media in messages - Add comprehensive test coverage with reliable Redis connections
bsbodden
added a commit
to bsbodden/spring-ai
that referenced
this pull request
May 4, 2025
…nectivity Refactor Redis-based chat memory implementation to: - Implement ChatMemoryRepository interface as requested in PR spring-projects#2295 - Fix Redis connection issues in integration tests reported in PR spring-projects#2982 - Optimize conversation ID lookup with server-side deduplication - Add configurable result limits to avoid Redis cursor size limitations - Implement robust fallback mechanism for query failures - Enhance support for metadata, toolcalls, and media in messages - Add comprehensive test coverage with reliable Redis connections Signed-off-by: Brian Sam-Bodden <[email protected]>
bsbodden
added a commit
to bsbodden/spring-ai
that referenced
this pull request
May 4, 2025
…nectivity Refactor Redis-based chat memory implementation to: - Implement ChatMemoryRepository interface as requested in PR spring-projects#2295 - Fix Redis connection issues in integration tests reported in PR spring-projects#2982 - Optimize conversation ID lookup with server-side deduplication - Add configurable result limits to avoid Redis cursor size limitations - Implement robust fallback mechanism for query failures - Enhance support for metadata, toolcalls, and media in messages - Add comprehensive test coverage with reliable Redis connections Signed-off-by: Brian Sam-Bodden <[email protected]>
bsbodden
added a commit
to bsbodden/spring-ai
that referenced
this pull request
May 4, 2025
…nectivity Refactor Redis-based chat memory implementation to: - Implement ChatMemoryRepository interface as requested in PR spring-projects#2295 - Fix Redis connection issues in integration tests reported in PR spring-projects#2982 - Optimize conversation ID lookup with server-side deduplication - Add configurable result limits to avoid Redis cursor size limitations - Implement robust fallback mechanism for query failures - Enhance support for metadata, toolcalls, and media in messages - Add comprehensive test coverage with reliable Redis connections Signed-off-by: Brian Sam-Bodden <[email protected]>
I'm on it Mark! - prelim PR #2991 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for taking time to contribute this pull request!
You might have already read the [contributor guide][1], but as a reminder, please make sure to:
main
branch and squash your commits