Skip to content

feat(ai): add conversation memory to Ask ApplyWell - #94

Merged
vitorhugo-dotnet merged 4 commits into
mainfrom
feat/93-assistant-conversation-memory
Sep 17, 2026
Merged

vitorhugo-dotnet merged 4 commits into
mainfrom
feat/93-assistant-conversation-memory

Conversation

@vitorhugo-dotnet

@vitorhugo-dotnet vitorhugo-dotnet commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements #93 using Spring AI native chat memory so Ask ApplyWell can resolve follow-up questions from the active conversation context.

Implementation

  • adds required conversationId: UUID to AssistantChatRequest
  • wires MessageChatMemoryAdvisor with MessageWindowChatMemory
  • supplies ChatMemory.CONVERSATION_ID on every assistant request
  • namespaces conversation memory server-side as <userId>:<conversationId> to prevent cross-user leakage
  • bounds conversation memory to 20 messages by default via app.assistant.memory-max-messages
  • updates the system prompt to preserve relevant organization/application/recruiter/status/platform/date-range filters across follow-ups
  • keeps existing read-only assistant tools unchanged
  • keeps the SSE event contract unchanged (token, error, complete)
  • does not introduce vector DB, embeddings, RAG, or persistent chat storage

Verification

TDD cycle was exercised explicitly:

  • RED: 425 tests, 6 expected failures from the new conversation-memory specification
  • GREEN: conversation memory implementation added
  • regression investigation: one test incorrectly inspected a record-component annotation; replaced with real Jakarta Validation behavior
  • final mvn -B -ntp clean verify: 425 tests, 0 failures, 0 errors, BUILD SUCCESS
  • AssistantConversationMemoryTest: 6/6 passing
  • Qodana workflow: success

The Qodana PR comment lists three repository-wide warnings. This workflow uses pr-mode: false, and the same three warnings were already reported on the initial test-only RED commit, so they are not introduced by the production implementation in this PR.

Covered scenarios

  • same conversationId retains previous user/assistant turns
  • different conversation IDs are isolated
  • the same client conversation UUID used by different authenticated users is isolated by server-side user namespacing
  • request validation requires a conversation ID
  • memory window is bounded
  • follow-up filter preservation is explicitly included in the system prompt

Persistence

This PR intentionally uses Spring AI's in-memory repository. Persistence across application restarts or multiple backend replicas was optional in #93 and is not required for the current deployment. The ChatMemory abstraction keeps a future move to JdbcChatMemoryRepository isolated from the HTTP contract.

Closes #93

@github-actions github-actions Bot added the tests label Sep 17, 2026
@github-actions

Copy link
Copy Markdown

Qodana for JVM

3 new problems were found

Inspection name Severity Problems
Nullability and data flow problems 🔶 Warning 1
Mismatched query and update of 'StringBuilder' 🔶 Warning 1
Simplifiable conditional expression 🔶 Warning 1
View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vitorhugo-dotnet
vitorhugo-dotnet marked this pull request as ready for review September 17, 2026 23:24
@vitorhugo-dotnet
vitorhugo-dotnet merged commit 6fc49e3 into main Sep 17, 2026
6 checks passed
@vitorhugo-dotnet
vitorhugo-dotnet deleted the feat/93-assistant-conversation-memory branch September 17, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(assistant): add conversation memory and follow-up context to Ask ApplyWell

1 participant