feat: add durable short and long-term memory - #593
Open
zxuexingzhijie wants to merge 11 commits into
Open
Conversation
# Conflicts: # data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/config/DataAgentConfiguration.java # data-agent-management/src/main/java/com/alibaba/cloud/ai/dataagent/service/graph/GraphServiceImpl.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/config/DataAgentConfigurationTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/controller/GraphControllerTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/integration/TextToSqlWorkflowIntegrationTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/service/graph/GraphServiceImplTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/service/graph/MultiTurnContextManagerTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/workflow/node/SchemaRecallNodeTest.java # data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/workflow/node/sql/SqlExecuteNodeTest.java
Use Spring AI ChatMemory and Spring AI Alibaba checkpoint and store primitives as infrastructure while keeping scoped durable turns, reviewed long-term memory, projection retries, cleanup, and schema publication fencing at the application boundary. Add direct frontend contract tests and MySQL 8.4 migration and publication integration coverage.
zxuexingzhijie
marked this pull request as ready for review
August 22, 2026 07:22
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
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.
Summary
MessageWindowChatMemorywithJdbcChatMemoryRepositoryfor the recent message window, Spring AI AlibabaMysqlSaverfor graph checkpoints, AlibabaStore/MemoryStorefor rebuildable exact-key projections, and Spring AIVectorStorefor semantic Top-K recall.agentId,conversationId,threadId, andturnId.schema_generationandschema_revision, serialize concurrent publication with MySQL advisory locks, and prevent stale generations from becoming visible.Responsibility split
MessageWindowChatMemory+ JDBC repositoryStore+MemoryStoreMysqlSaverwith its node-local latest cache disabledVectorStoreconversation_turn,turn_run,turn_artifact,memory_item, andmemory_outboxown lifecycle, review, idempotency, and recovery factsLifecycle and consistency changes
Database upgrade
Existing MySQL installations must apply these migrations in order before starting the updated application:
V20260729_01__create_durable_memory.sqlV20260820_01__add_datasource_schema_revision.sqlAfter upgrading, re-run schema initialization for each existing datasource so a stable
schema_revisionis published. The previous revision is invalidated before extraction; a new revision becomes visible only when all vectors from the same generation finish publishing.Verification
GET_LOCK, and generation fencing observed from another connection.git diff --checkall passed on the clean commit candidate.Documentation
ARCHITECTURE.md/ARCHITECTURE-en.md: document the framework/application ownership boundary and the realMemoryProjectionWorker, lifecycle cleanup, long-term-memory, and WebFlux authentication flows.DEVELOPER_GUIDE.md/DEVELOPER_GUIDE-en.md: document memory/checkpoint configuration, outbox scheduling and retention, identifier lifecycles, long-term-memory REST/error contracts, schema migrations, generation fencing, framework-owned table creation, and the real-MySQL test command.ADVANCED_FEATURES.md/ADVANCED_FEATURES-en.md: replace the obsolete custom Servlet interceptor example with the implemented WebFlux API Key contract, protected endpoints, authenticated SSE and long-term-memory examples, and the nativeEventSourcelimitation.QUICK_START.md/QUICK_START-en.md: repair all section anchors after the new conversation-memory section and keep the Sandbox runtime version current.Explicit validation boundaries
*ITunder the repository's existingintegrationprofile. The default GitHub build currently runsmake verify, so this real-MySQL test is not yet part of the default workflow.EventSourceand cannot attach an API Key header. API-key-enabled agents therefore require a header-capable external SSE client; the documentation now states this existing product boundary, and this memory PR does not introduce an insecure query-parameter fallback.