Multi-agent workflow with persistent memory sharing using Mastra and Trigger.dev for clothing recommendations based on weather data.
triggerAndWait
for sequential agent executiontriggerAndWait
for sequential agent execution and shared memory contextsrc/mastra/index.ts
) and automatically inherited by all agent Memory instances. This eliminates the “duplicate database object” warning that can occur with multiple PostgreSQL connections.
The PostgreSQL storage works seamlessly in both local development and serverless environments with any PostgreSQL provider, such as: