Add Mastra Next.js Postgres Redis sample - #628
Merged
Merged
Conversation
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 1, 2026 19:01 — with
GitHub Actions
Failure
raphaeltm
marked this pull request as draft
April 1, 2026 19:09
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 4, 2026 12:29 — with
GitHub Actions
Failure
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 7, 2026 09:37 — with
GitHub Actions
Failure
…c models - Replace 3s polling with SSE endpoint (/api/dashboard/stream) for real-time queue progress at 300ms intervals - Switch from JSONB embeddings to pgvector for cosine similarity search in SQL - Use Mastra model router with provider/model format (e.g. bedrock/model-name) instead of AWS-specific runtime detection - Update all deps to latest (Mastra 1.x, ai SDK 6.x, zod 4.x) - Remove separate embedding Docker service from compose.yaml - Extract hooks (useChat, useDashboard), components (ItemCard, ChatMessage), types, and formatting utils from page.tsx for readability - Refactor chat route into focused functions (parseChatRequest, handleStreamingRequest, handleNonStreamingRequest) - Consolidate duplicate runChatJson/runChatText into shared runChat() - Extract fallback seed data to seed-data.ts - Fix Mastra 1.x breaking changes (Agent id, tool execute signature, PostgresStore id, telemetry removal, v3 model spec) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 7, 2026 19:45 — with
GitHub Actions
Failure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 7, 2026 19:47 — with
GitHub Actions
Failure
…e dedup - Add MOCK_AGENT and LLM_MODEL to worker in compose.dev.yaml (was crashing) - Add MOCK_AGENT to worker in compose.yaml for clarity - Align Redis version to 6.2 in both compose files - Import ChatStreamEvent from shared types instead of duplicating - Remove unnecessary useMemo wrappers in page.tsx - Remove dead code: runChatText, answerQuestionWithContext - Remove unused _query param from searchItemsByEmbedding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 7, 2026 19:56 — with
GitHub Actions
Failure
… OPENAI_API_KEY - Add doc comments to chat route, hooks, agent, mastra index, and key ai.ts functions (parseJsonFromText, deterministicEmbedding, thinking splitter) - Move tsx from devDependencies to dependencies (worker needs it at runtime) - Add EMBEDDING_MODEL to compose.dev.yaml for dev/prod parity - Remove unused OPENAI_API_KEY from both compose files - Deduplicate SQL filter logic: extract shared applyFilters() used by both getItemsByType and searchItemsByEmbedding - Share QUEUE_NAME constant between queue.ts and worker.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 8, 2026 13:15 — with
GitHub Actions
Failure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 8, 2026 16:41 — with
GitHub Actions
Failure
- Add Prerequisites section (Defang CLI, BYOC, Docker) - Add proper Deployment section with Playground + BYOC subsections - Add NOTE/WARNING callouts matching other samples - Add LLM_MODEL/EMBEDDING_MODEL format examples (provider/model) - Remove non-standard Features section (moved to description) - Remove inline PostgreSQL TLS documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 8, 2026 16:56 — with
GitHub Actions
Failure
…portability Adds a generatorAgent (Mastra agent with no tools) used by the worker for seed generation and classification. All LLM calls now flow through Mastra, so users can switch providers (Bedrock, OpenAI, Anthropic, Google) by changing LLM_MODEL / EMBEDDING_MODEL — no code changes needed. model.ts keeps a native Bedrock path for AWS IAM auth (Mastra's router only supports API-key providers), but this is an implementation detail hidden from the app code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 10, 2026 15:11 — with
GitHub Actions
Failure
Updated the description of the background worker's functionality to clarify the process of task generation and storage.
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 10, 2026 16:42 — with
GitHub Actions
Failure
The DROPs were added during iteration to pick up schema changes on redeploy. Schema is stable now, so preserve data across deploys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 10, 2026 16:56 — with
GitHub Actions
Failure
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 15, 2026 14:30 — with
GitHub Actions
Failure
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 15, 2026 14:45 — with
GitHub Actions
Failure
…:DefangLabs/samples into feat/mastra-nextjs-postgres-redis-sample
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 15, 2026 14:46 — with
GitHub Actions
Error
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 15, 2026 14:47 — with
GitHub Actions
Failure
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 17, 2026 17:02 — with
GitHub Actions
Failure
raphaeltm
marked this pull request as ready for review
April 17, 2026 17:05
Closed
raphaeltm
had a problem deploying
to
deploy-changed-samples
April 17, 2026 18:28 — with
GitHub Actions
Failure
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
mastra-nextjs-postgres-redissample in the samples catalogVerification
npm run builddocker compose -f compose.dev.yaml up --build -d/api/health,/api/jobs/sync,/api/jobs, and/api/chatNotes
MOCK_AGENT=truefor fully functional compose-based verification without external model credentialschatmodel service viax-defang-llmSamples Checklist
✅ All good!