Pattern: Custom ChatMemoryStore with JPA/Panache + quarkus-flow-jpa for durable workflows
Narrative: The gap from Step 03: restart the app and everything is lost — suspended workflows, conversations, all of it. A customer says "I'll think about it" and comes back the next day to find the system has forgotten everything. This step introduces a PostgreSQL database that makes two things persistent at once: conversation memory and workflow state.
What participants build:
- Custom
DatabaseChatMemoryStore implementation backed by a database (~30 lines)
Starter code provides:
- Conversational
TripChatAgent (@RegisterAiService with @MemoryId)
TripPlannerTools bridge to existing workflow
/trip/chat REST endpoint
ChatMessageEntity JPA entity
DatabaseChatMemoryProviderSupplier CDI wiring
quarkus-flow-jpa dependency (makes Quarkus Flow workflows from Step 03 durable — zero code changes to Flow)
- Database setup via Dev Services (PostgreSQL)
Key learning: One database, two persistence wins. Conversations survive restarts via ChatMemoryStore. Quarkus Flow workflows survive restarts via quarkus-flow-jpa with autoRestore=true — the TripPlannerFlow from Step 03 is completely unchanged. The satisfying payoff: "remember how the workflow was lost when you restarted? Not anymore."
Pattern: Custom ChatMemoryStore with JPA/Panache + quarkus-flow-jpa for durable workflows
Narrative: The gap from Step 03: restart the app and everything is lost — suspended workflows, conversations, all of it. A customer says "I'll think about it" and comes back the next day to find the system has forgotten everything. This step introduces a PostgreSQL database that makes two things persistent at once: conversation memory and workflow state.
What participants build:
DatabaseChatMemoryStoreimplementation backed by a database (~30 lines)Starter code provides:
TripChatAgent(@RegisterAiServicewith@MemoryId)TripPlannerToolsbridge to existing workflow/trip/chatREST endpointChatMessageEntityJPA entityDatabaseChatMemoryProviderSupplierCDI wiringquarkus-flow-jpadependency (makes Quarkus Flow workflows from Step 03 durable — zero code changes to Flow)Key learning: One database, two persistence wins. Conversations survive restarts via
ChatMemoryStore. Quarkus Flow workflows survive restarts viaquarkus-flow-jpawithautoRestore=true— theTripPlannerFlowfrom Step 03 is completely unchanged. The satisfying payoff: "remember how the workflow was lost when you restarted? Not anymore."