spring-projects / spring-projects/spring-ai

MessageChatMemoryAdvisor with conversationId supplier

Open
#4,985 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chat memory
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Expected Behavior

It would be perfect to allow MessageChatMemoryAdvisor work based on the conversationId supplier instead of static value. User would not need to always remember about putting proper conversationId.

MessageChatMemoryAdvisor.builder(chatMemory).conversationIdSupplier(conversationIdHolder::get).build();

Current Behavior

We need to manually provide conversationId

.advisors(a -> a.param(ChatMemory.CONVERSATION_ID, conversationId))

if we dont want to use separate messages history/context.

Context

I would be happy to prepare Pull Request with example implementation and tests.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating MessageChatMemoryAdvisor and its builder, then trace how conversationId is currently read from advisor parameters. Review the advisor's existing tests and add coverage for conversationIdSupplier, including the supplied value being used during a request. Done means callers can configure the supplier shown in the issue without manually setting ChatMemory.CONVERSATION_ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.