Skip to content

Replace ChatMemory with Spring AI Session abstraction - #85

Open
arefbehboudi wants to merge 2 commits into
mainfrom
feature/79-session-abstraction
Open

arefbehboudi wants to merge 2 commits into
mainfrom
feature/79-session-abstraction

Conversation

@arefbehboudi

Copy link
Copy Markdown
Collaborator

Migrate conversation persistence from ChatMemoryRepository to the spring-ai-session SessionService:

  • Add spring-ai-session 0.7.0 dependency
  • Replace FileSystemChatMemoryRepository/ChatYamlSerializer with FileSystemSessionRepository
  • Wire SessionMemoryAdvisor with token-count-triggered compaction (turn-window strategy, 50k token threshold)
  • Update ChatChannel and DefaultAgent to use sessions keyed by a single-tenant agent user id

Closes #75

@arefbehboudi
arefbehboudi requested a review from rdehuyss August 19, 2026 10:14
Migrate conversation persistence from ChatMemoryRepository to the
spring-ai-session SessionService:

- Add spring-ai-session 0.7.0 dependency
- Replace FileSystemChatMemoryRepository/ChatYamlSerializer with
  FileSystemSessionRepository
- Wire SessionMemoryAdvisor with token-count-triggered compaction
  (turn-window strategy, 50k token threshold)
- Update ChatChannel and DefaultAgent to use sessions keyed by a
  single-tenant agent user id
Replace the single global lock with a ReentrantLock per session so
different sessions no longer block each other. Session files are now
written to a temp file and atomically moved into place, so reads never
see a partially written file and no longer need a lock.
@arefbehboudi
arefbehboudi force-pushed the feature/79-session-abstraction branch from 56076a1 to cc1d4e3 Compare October 7, 2026 07:56
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.

[Task] Adopt spring-ai-session for conversation memory and compaction

1 participant