## Summary
Adds 5 new project templates under `templates/` that showcase the newest
Mastra features. All templates use Mastra Gateway as the AI provider
(`MASTRA_GATEWAY_API_KEY`) with `mastra/`-prefixed model IDs—no direct
provider API keys needed for LLM access.
### New templates
| Template | Key features | Model | DB |
|---|---|---|---|
| **template-docs-expert** | Provider-native web search via gateway,
observational memory, structured citations | `gpt-5-mini` | LibSQL
(Turso) |
| **template-browser-agent** | AgentBrowser (Playwright), browser tools,
web search fallback | `gpt-5-mini` | LibSQL (Turso) |
| **template-meeting-notes** | Zoom S2S OAuth cloud recordings,
transcription, structured notes, Linear/Notion export, ingest workflow |
`gpt-5.4` | LibSQL (Turso) |
| **template-company-knowledge** | Linear + Notion SDK tools, pgvector
semantic search, knowledge indexing workflow | `gpt-5.4` | PostgreSQL
(Neon) |
| **template-claw-assistant** | Autonomous computer-operating agent:
Workspace + LocalFilesystem + LocalSandbox + AgentBrowser + skills |
`gpt-5.4` | LibSQL (Turso) |
### Design decisions
- **Web search**: Uses `openai.tools.webSearch()` provider tool routed
through Mastra Gateway (OpenRouter-backed). No separate search API key
required.
- **Model tiers**: Reasoning-heavy templates (Claw, Company Knowledge,
Meeting Notes) use `gpt-5.4`; simpler tool-flow templates (Docs Expert,
Browser Agent) use `gpt-5-mini`.
- **Existing template**: `template-browsing-agent` (Stagehand) kept
alongside new `template-browser-agent` (AgentBrowser). Both READMEs
cross-link.
- **Zoom integration**: Server-to-Server OAuth (single-workspace, no
end-user OAuth dance). End-user OAuth is a follow-up.
- **Embeddings**: Company Knowledge template uses `@ai-sdk/openai`
embeddings directly (`OPENAI_API_KEY`) since the gateway doesn't proxy
embeddings.
- **No changeset**: Templates are standalone projects, not pnpm
workspace packages.
### Per template
- [x] `pnpm install --ignore-workspace` succeeds
- [x] `pnpm tsc --noEmit` passes
- [x] Every `process.env.*` documented in `.env.example`
- [x] README setup steps match actual env vars and scripts
## Test plan
Each template typechecks cleanly with `tsc --noEmit`. Full runtime
testing requires platform deployment with injected env vars (gateway
key, DB connection, integration keys).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR adds five complete example projects (templates) that show
developers how to build AI-powered applications using Mastra's latest
features. These templates work by sending requests through a central
Mastra Gateway instead of using API keys directly, making them simpler
and more secure. Think of it like having instruction manuals that show
you how to assemble different things—one for searching documents, one
for controlling web browsers, one for taking meeting notes, one for
searching company knowledge, and one for an autonomous assistant.
## Overview
Added five production-ready template projects demonstrating
Gateway-first Mastra architectures with structured patterns for agents,
workflows, tools, and storage:
- **template-docs-expert** — Web search-powered documentation expert
agent with observational memory (Turso/LibSQL)
- **template-browser-agent** — AgentBrowser-based autonomous web
navigation with browser tools and web search fallback (Turso/LibSQL)
- **template-meeting-notes** — Zoom S2S OAuth cloud recordings →
structured notes + optional Linear/Notion export via MCP (Turso/LibSQL)
- **template-company-knowledge** — Linear + Notion knowledge indexing
with pgvector semantic search and multi-source lookup workflow
(PostgreSQL/Neon with pgvector)
- **template-claw-assistant** — Autonomous computer agent with sandboxed
workspace, file I/O, shell execution, and browser automation
(Turso/LibSQL)
Each template includes `.env.example`, `.gitignore`, `package.json` with
required dependencies, TypeScript configuration, and comprehensive
README with setup/customization guidance.
## Key Implementation Details
**Model & Gateway Routing:**
- All chat models route through Mastra Gateway using
`mastra/openai/gpt-5.4` (reasoning-heavy) or `gpt-5-mini` (lighter
flows)
- Web search implemented via `openai.tools.webSearch()` routed through
OpenRouter-backed Gateway
- Embedding models (`text-embedding-3-small`) use
`ModelRouterEmbeddingModel` because Gateway does not proxy embeddings
(direct `@ai-sdk/openai` with `OPENAI_API_KEY`)
**Agents & Memory:**
- Structured memory configurations with `lastMessages` retention (10-20
messages depending on template) and `observationalMemory` for implicit
context
- Meeting notes agent includes `meetingNotesOutputSchema` Zod schema for
structured output enforcement
- Knowledge agent includes input normalization (Unicode, whitespace
collapsing) and output redaction (PII/secrets detection)
**Workflows:**
- Meeting notes: `ingestMeetingWorkflow` chains Zoom transcript fetch →
summarization with structured output
- Company knowledge: `indexKnowledgeWorkflow` scheduled every 6 hours,
pulls Linear issues + Notion pages, embeds via Gateway, upserts to
pgvector
**MCP Integration:**
- Meeting notes & company knowledge templates conditionally wire Linear
(HTTP remote) and Notion (stdio subprocess) MCP servers based on
presence of API keys
- Tools dynamically discovered at module load via
`mcpClient.listTools()`
**Storage:**
- LibSQL (Turso): docs-expert, browser-agent, meeting-notes,
claw-assistant templates
- PostgreSQL (Neon) with pgvector: company-knowledge template for
semantic search
**Zoom S2S OAuth:**
- `fetchZoomAccessToken()` caches tokens with expiry-aware refresh
- Three exported tools: `listRecentMeetings`, `getMeetingRecording`,
`fetchZoomTranscript`
## Additional Changes
- **Existing templates**: Removed `defaultOptions: { maxSteps: ... }`
from `template-github-review-agent` and `template-google-sheets` agents
- **Documentation**: Added "Available templates" section to
`docs/src/content/en/reference/templates/overview.mdx` with template
listing
- **Templates README**: Expanded `templates/README.md` with "New
Gateway-first templates" section
- **Changeset**: Added `@mastra/core` minor release documenting Gateway
embedding routing support via `ModelRouterEmbeddingModel`
## Validation
- `pnpm install --ignore-workspace` and `pnpm tsc --noEmit` confirmed to
succeed
- `.env.example` documents all required env vars
- README setup steps align with npm/pnpm scripts
- Runtime testing deferred (requires platform-deployed secrets and DB
connections)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
Migrates the workspace to pnpm 11.3.0 and moves pnpm config out of
package.json into pnpm-workspace.yaml, which is where pnpm v11 reads
these settings.
It also enables the global virtual store for faster git worktree
installs:
```yaml
# Share pnpm's virtual store across git worktrees: https://pnpm.io/git-worktrees
enableGlobalVirtualStore: true
```
I also moved the standalone e2e fixture pnpm settings into local
pnpm-workspace.yaml files so their overrides and build approvals still
apply under pnpm v11.
Verified with pnpm 11.3.0 install --frozen-lockfile and git diff
--check.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR upgrades the repository to pnpm v11 (11.3.0), moves workspace
pnpm settings out of package.json into pnpm-workspace.yaml so pnpm v11
reads them, and enables a shared global virtual store to speed up
installs (useful for git worktrees). It also updates tests, fixtures,
and CI to use pnpm-specific env vars and workspace-aware installs.
## Changes Overview
### Core changes
- Bumped required pnpm in root package.json: engines.pnpm → >=11.0.0 and
updated packageManager to pnpm@11.3.0 (with new integrity).
- Added/expanded top-level pnpm-workspace.yaml:
- enableGlobalVirtualStore: true to share pnpm’s virtual store across
git worktrees.
- Reworked patchedDependencies to versioned patch entries (e.g.,
`@changesets/get-dependents-graph`@2.1.3/2.1.4, tsup@8.5.1).
- Added packageExtensions (e.g., `@uiw/codemirror-theme-dracula`@*).
- Extended trustPolicyExclude and expanded overrides to constrain many
deps (ssri, qs, zod variants, etc.).
- Broadened allowBuilds to explicitly disable builds for many packages.
### E2E & fixture workspace changes
- Removed pnpm/resolutions and top-level pnpm blocks from many
package.json files and introduced local pnpm-workspace.yaml files in
fixture/e2e directories (commonjs, create-mastra, deployers, monorepo,
no-bundling, type-check, memory, agent-builder, mcp, playground
kitchen-sink, pkg-outputs, etc.).
- Those local pnpm-workspace.yaml files reintroduce necessary overrides
(e.g., ssri >=6.0.2, qs ^6.15.1) and allowBuilds settings so
fixture-specific build allowances and overrides continue to apply under
pnpm v11.
### Tests & tooling updates
- Updated many e2e tests and setup scripts to export pnpm-specific env
vars (pnpm_config_registry, pnpm_config_minimum_release_age, etc.)
instead of npm_config_* so pnpm receives registry/minimum-release-age
configs.
- Extended pnpm-specific env var allowlist (packages/_types-builder)
with additional pnpm_config_* keys.
- Small TypeScript typings and build tweaks (tsup externals, various
Droppable typing updates).
- Patch update: changesets-get-dependents-graph patch updated to
construct Range with includePrerelease: true.
### CI & GitHub Actions
- Composite action explicitly sets up Node 22 via actions/setup-node@v6
and continues to install pnpm via pnpm/action-setup@v4.
- Turbo action now runs turborepo via pnpm dlx (pnpm dlx turbo ...) and
disables telemetry.
- Multiple CI steps and workflows changed pnpm install
--ignore-workspace → pnpm install to be workspace-aware where
appropriate.
### Commit / migration notes
- Added commit(s) to preserve nested pnpm workspace configs for
fixtures, add missing packageExtensions, and make other adjustments
required by pnpm v11 (including explicit allowBuilds in nested
workspaces so frozen installs pass).
- Author verified migration with pnpm 11.3.0 using install
--frozen-lockfile and git diff --check, but noted further
testing/investigation will follow (primary motivation: enable
worktree/global virtual store behavior).
## Impact & reviewer notes
- Requires pnpm >=11.0.0 locally and in CI (declared 11.3.0). Update
local tooling if needed.
- Workspace overrides, patched deps, and build allowances were relocated
to pnpm-workspace.yaml — reviewers should confirm fixture behavior,
package linking, and build approvals still match expectations.
- enableGlobalVirtualStore changes dependency layout/hoisting for
worktree installs; test git worktree installs and CI runs.
- Verify e2e fixtures, CI jobs, and any environment-specific
registry/settings propagate correctly via pnpm_config_* env vars.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/mastra-ai/mastra/pull/17038?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.5) <noreply@mastra.ai>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added "Chat with PDF" template: PDF ingestion and indexing, semantic
vector search, page-aware Q&A with citations, document listing, and quiz
generation.
* **Documentation**
* Added comprehensive Mastra guides: setup, embedded vs remote docs
lookup, troubleshooting, migration, contribution notes, and template
README/usage.
* **Configuration**
* Added template scaffolding: package manifest, TypeScript config,
example env, and .gitignore for the template.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: LekoArts <lekoarts@gmail.com>
## Description
Adds an AI-powered code review agent built with
[Mastra](https://mastra.ai/) that analyzes any GitHub pull request and
returns detailed feedback directly in chat. It uses a structured
workflow, workspace skills for review standards, observational memory
for managing context across large PRs, and adaptive review depth based
on PR size.
https://github.com/user-attachments/assets/6bef659b-e0a1-46e8-a8e5-affd96304184
## Related Issue(s)
Fixes DEVED-3
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [X] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a GitHub PR code-review agent template with two preconfigured
reviewers, end-to-end PR review workflow, adaptive batching for
different PR sizes, GitHub fetch tools, structured review outputs, and
validation schemas.
* Includes local workspace wiring and run/build scripts for the
template.
* **Documentation**
* Added README, CONTRIBUTING, setup guides, code standards, security and
performance skills, and detailed checklists and style guide.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->