The `get` method of `RedisChatMemoryRepository` only returns data of type `USER`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 64/100
Research direction
Start at RedisChatMemoryRepository#get(String, int) and inspect the Redis index schema around schemaFields.add(...). Reproduce the search with the supplied redis-cli commands and verify that both USER and ASSISTANT records are returned; done is a query that returns both types.
Written by the indexing model from the issue text.
Description
Bug description
Suspected that there was a problem with creating the index
schemaFields.add(new TextField("$.type").as("type"));
I think need change to TagField like
schemaFields.add(new TagField ("$.type").as("type"));
Environment
springboot 4.0.4
spirng ai 2.0.0-M3
Steps to reproduce
- AI and I have a conversation. Redis stores two pieces of data, one of type user and the other of type ASSISTANT, but org.springframework.ai.chat.memory.repository.redis.RedisChatMemoryRepository#get(java.lang.String, int) The method only returned one piece of data, of type user
- Then I checked and found out that the type was text, so I manually created the index and returned it correctly
#One click repair
redis-cli FT.DROPINDEX my-chat-index
redis-cli FT.CREATE my-chat-index ON JSON PREFIX 1 "my-chat:" SCHEMA $.conversation_id AS conversation_id TAG $.type AS type TAG $.content AS content TEXT $.timestamp AS timestamp NUMERIC SORTABLE
#Verification
redis-cli FT.SEARCH my-chat-index "@conversation_id:{1}"
Expected behavior
Minimal Complete Reproducible example
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-projects/spring-ai
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
spring-projects/spring-ai#7022 · 2 comments ·
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
spring-projects/spring-ai#7000 ·
-
status: waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
spring-projects/spring-ai#6998 ·
-
[Bug - MCP server] @McpTool error messages are emitted twice when the thrown exception has no cause Openstatus: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spring-projects/spring-ai#6948 · 1 comment · 1 reaction ·
-
status: waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
spring-projects/spring-ai#6940 · 1 comment ·
All issues in spring-projects/spring-ai
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100