Skip to content

In product copilot tutorial#2957

Merged
Gaurav-Narayan-Varma merged 2 commits intomainfrom
in-product-copilot-tutorial
Apr 1, 2026
Merged

In product copilot tutorial#2957
Gaurav-Narayan-Varma merged 2 commits intomainfrom
in-product-copilot-tutorial

Conversation

@Gaurav-Narayan-Varma
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Apr 1, 2026 6:42pm
agents-docs Ready Ready Preview, Comment Apr 1, 2026 6:42pm
agents-manage-ui Ready Ready Preview, Comment Apr 1, 2026 6:42pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: aacaf29

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog Bot commented Apr 1, 2026

TL;DR — Adds a new end-to-end tutorial for building an in-product copilot using the Visual Builder, covering agent setup, per-user header forwarding to MCP servers, embedding the chat component, and testing. Also includes a minor auto-generated update to the evaluations API reference.

Key changes

  • Add in-product-copilot.mdx tutorial — New step-by-step guide walking through creating a copilot agent, defining a headers schema for per-user auth, connecting an MCP server with {{headers.*}} template forwarding, embedding the React/JS chat component, and testing in both the playground and a live app.
  • Add in-product-copilot-flow.png diagram — Architecture image showing the header forwarding flow from host app → Inkeep agent → MCP server.
  • Register the new page in meta.json — Adds in-product-copilot to the agents guides navigation.
  • Update evaluations.mdx API reference — Adds the batch-get-agent-scopes-for-evaluators endpoint entry (auto-generated by Fumadocs).

Summary | 4 files | 3 commits | base: mainin-product-copilot-tutorial


In-product copilot tutorial

Before: No documentation for building copilots that forward per-user credentials to MCP servers at runtime.
After: A complete tutorial covers the full flow — agent creation, headers schema, MCP server registration with {{headers.*}} template injection, client-side embedding (React and vanilla JS), and a two-phase testing workflow.

The guide targets a common pattern: embedding a copilot in a SaaS product where each signed-in user's auth token and user ID must be forwarded to backend MCP tools on every request. The headers schema validates incoming keys, and {{headers.*}} templates resolve at runtime on each tool call.

How does per-user header forwarding work? The host application passes custom headers (e.g., auth_token, user_id) via the chat component's headers config. The agent validates these against the headers schema defined on the root agent. When making tool calls to MCP servers, Inkeep resolves {{headers.auth_token}} and {{headers.user_id}} templates into the actual header values from the current request, injecting them as Authorization and X-User-Id headers on the outbound MCP call.

agents-docs/content/guides/agents/in-product-copilot.mdx · agents-docs/content/guides/agents/meta.json · agents-docs/public/images/in-product-copilot-flow.png

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Claude Opus𝕏

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-structured tutorial that follows existing doc conventions. One minor nit below. The evaluations.mdx change looks like an unrelated auto-generated Fumadocs regeneration — consider splitting it into a separate commit or PR to keep the diff focused.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Claude Opus𝕏

2. Your MCP server logs show the correct auth token and user ID on each tool call
3. Switching users changes the data the copilot returns
</Step>
</Steps> No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline. Most editors and linters expect files to end with .

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

(2) Total Issues | Risk: Medium

🟠⚠️ Major (1) 🟠⚠️

Inline Comments:

  • 🟠 Major: in-product-copilot.mdx:164 JavaScript example missing required DOM selector argument

🟡 Minor (1) 🟡

Inline Comments:

  • 🟡 Minor: in-product-copilot.mdx:4 Description doesn't highlight key differentiator (per-user credential forwarding)

🕐 Pending Recommendations (1)

💭 Consider (1) 💭

💭 1) evaluations.mdx Unrelated auto-generated change

Issue: The evaluations.mdx file contains an auto-generated Fumadocs update adding the batch-get-agent-scopes-for-evaluators endpoint, which is unrelated to the tutorial.

Why: Mixing unrelated auto-generated changes with feature content makes git history harder to navigate and can make the diff misleading when reviewing the actual tutorial changes.

Fix: Consider splitting this into a separate commit or PR to keep the tutorial change focused.


🚫 REQUEST CHANGES

Summary: Great tutorial teaching a valuable pattern (per-user header forwarding to MCP servers)! The JavaScript code example has a bug that will cause runtime errors — the Inkeep.EmbeddedChat() call is missing the required DOM selector as the first argument. Please apply the 1-click suggestion to fix this before merging.

Discarded (0)

No findings were discarded.

Reviewers (1)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
orchestrator 3 0 1 0 2 0 0
Total 3 0 1 0 2 0 0

Note: Docs-only PR reviewed inline by orchestrator without dispatching sub-agents.

<Tab title="JavaScript">

```javascript
const chat = Inkeep.EmbeddedChat({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 MAJOR: JavaScript example missing required DOM selector argument

Issue: The JavaScript API for Inkeep.EmbeddedChat() requires a DOM selector string as the first argument, but this example omits it.

Why: Users copying this code will get runtime errors. The documented patterns at embedded-chat.mdx and app-credentials.mdx both show the correct pattern: Inkeep.EmbeddedChat('#selector', config).

Fix: (1-click apply)

Suggested change
const chat = Inkeep.EmbeddedChat({
const chat = Inkeep.EmbeddedChat('#copilot-container', {

Refs:

---
title: Build an in-product copilot without code
sidebarTitle: In-Product Copilot
description: Step-by-step tutorial to build an in-product copilot.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Minor: Description doesn't highlight key differentiator

Issue: The description is generic and doesn't mention the tutorial's unique value: per-user credential forwarding to MCP servers.

Why: Users scanning search results or navigation won't understand what makes this tutorial different from other copilot tutorials. The description should reflect the tutorial's core teaching — header forwarding for personalized, user-scoped agent responses.

Fix: (1-click apply)

Suggested change
description: Step-by-step tutorial to build an in-product copilot.
description: Build an in-product copilot that forwards user credentials to MCP servers for personalized responses.

Refs:

@github-actions github-actions Bot deleted a comment from claude Bot Apr 1, 2026
@Gaurav-Narayan-Varma Gaurav-Narayan-Varma added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 7c1dceb Apr 1, 2026
30 checks passed
@Gaurav-Narayan-Varma Gaurav-Narayan-Varma deleted the in-product-copilot-tutorial branch April 1, 2026 18:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

🔎💬 Inkeep AI search and chat service is syncing content for source 'Inkeep Agent Framework Docs'

dimaMachina pushed a commit that referenced this pull request Apr 2, 2026
* docs build updated api reference

* tutorial done
github-merge-queue Bot pushed a commit that referenced this pull request Apr 2, 2026
* chore(dashboard): dockerize visual regression tests for cross-OS consistency

Run Playwright browser inside a Docker container so visual screenshot
tests produce identical results on macOS (local dev) and Linux (CI).

- Add docker-compose.visual.yml with Playwright server container
- Update vitest config to connect to Docker browser via websocket
  when PW_TEST_CONNECT_WS_ENDPOINT env var is set
- Add test:visual and test:visual:update npm scripts
- Update CI workflow to use Docker Playwright server instead of
  bare Playwright install
- Regenerate screenshot baselines from Linux container

Closes PRD-6191

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: address PR review feedback

- Add explicit failure handling if Playwright server doesn't start
- Bind Docker port to 127.0.0.1 only (don't expose to network)
- Align npx playwright version with Docker image (both 1.58.0)

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: restore Playwright install step in CI

The @vitest/browser-playwright package requires a local Playwright
install to initialize, even when the actual browser runs in Docker
via connectOptions. Keep the install step alongside the Docker server.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix(dashboard): pass PW_TEST_CONNECT_WS_ENDPOINT through turbo strict mode

Turbo v2 strict mode filters env vars not listed in turbo.json from
child processes. The Playwright WebSocket endpoint was being silently
dropped, causing vitest to fall back to local Chromium instead of the
Docker server — producing mismatched screenshots in CI.

Also pins docker-compose.visual.yml to linux/amd64 so local baselines
match CI regardless of host architecture (see
microsoft/playwright#13873), and fixes the
Playwright cache restore-keys prefix mismatch.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* docs: add visual regression test workflow to AGENTS.md

* fix(dashboard): resolve Monaco strict locator violation in nested error state visual test

* fix(dashboard): fix Monaco strict locator violation with data-testid and stable render wait

* Refactor vitest.config.ts by removing unused code

* Update vitest.config.ts

* fix(dashboard): restore onUnhandledError handler for Monaco browser tests

The previous refactor removed the onUnhandledError handler, causing CI
to fail with exit code 1 due to 3 known, unfixable Monaco Editor errors
in Vitest browser mode:

1. "Cannot use import statement outside a module" - Monaco web workers
   cannot load ESM in the Vitest browser sandbox
2. "InvalidCharacterError" / "is not a valid name" - Monaco attempts
   createElement with an SVG data URI as the tag name
3. "Closing rpc while" - Vitest worker RPC shutdown race condition

These errors were originally suppressed by Nick in #2046 and #2078 after
investigation confirmed they are unfixable Monaco/Vitest internals that
do not affect test correctness.

Refs: #2046, #2078

* fix(dashboard): remove unused pixelmatch devDependency

The pixelmatch package is no longer imported after the vitest.config.ts
refactor removed the custom tolerantPixelmatch comparator. Knip
correctly flags it as unused.

* fix

* upd

* upd

* format

* lock

* rm

* fix

* Create fluffy-gorillas-joke.md

* Apply suggestion from @claude[bot]

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>

* fix(@inkeep/agents-work-apps): mark `@slack/socket-mode` as `dependency` (#2951)

* upd

* upd

* Apply suggestion from @dimaMachina

* Apply suggestion from @dimaMachina

* Create breezy-lemons-dream.md

* Document MCP header forwarding in Visual Builder docs (#2956)

* docs: add MCP header forwarding and fix header key casing examples

* updated warnings in headers docs

* updated warnings in mcp servers docs

* In product copilot tutorial (#2957)

* docs build updated api reference

* tutorial done

* implements pnpm minimumReleaseAge and upgrades pnpm to 10.33.0 (#2958)

* implements pnpm minimumReleaseAge

* upgrades pnpm to 10.16.0

* upgrades pnpm to 10.33.0

* ci: surface stable preview URLs in PRs (#2799)

* ci: surface stable preview urls in PRs

* fix: add temp file cleanup trap and paginate comment search

- Add EXIT trap to clean up mktemp file
- Paginate through all PR comments when searching for the existing
  marker comment, fixing duplicate-comment risk on PRs with 100+ comments

Co-authored-by: Andrew Mikofalvy <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>

* ci: fix preview URL comment updates

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Andrew Mikofalvy <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat: S3 presigned URLs for private media delivery (#2887)

* feat: add S3 presigned URL support for private media delivery

- Add optional getPresignedUrl() to BlobStorageProvider interface
- Implement in S3BlobStorageProvider using @aws-sdk/s3-request-presigner
- Make resolveMessageBlobUris() async with presigned URL first, manage
  proxy fallback for non-S3 backends (Option D hybrid)
- Update both call sites (run + manage conversation routes) with await
- Add presigned URL tests to s3-provider and resolve-blob-uris test suites
- Include full spec with evidence files

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* docs: add S3 blob storage deployment guide

Covers S3 setup, IAM permissions, env vars, S3-compatible services,
storage backend priority, and presigned URL delivery flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* chore: add changeset for S3 presigned URL support

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: add error handling for presigned URL failures with proxy fallback

- Wrap getPresignedUrl() in try-catch so failures fall through to manage
  proxy URL instead of crashing the entire conversation response
- Add test for presigned URL failure → proxy fallback path
- Add mixed-content test with presigned URLs active
- Fix doc icon quoting convention

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: correct callout type and remove inaccurate configurable claim in docs

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* feat: make presigned URL expiry configurable via `BLOB_STORAGE_PRESIGNED_URL_EXPIRY_SECONDS`

- Add `BLOB_STORAGE_PRESIGNED_URL_EXPIRY_SECONDS` to env.ts Zod schema
  (default 7200s / 2 hours, range 60–604800)
- Replace hardcoded `DEFAULT_PRESIGNED_EXPIRY_SECONDS` constant in
  s3-provider.ts with env var lookup
- Update tests to use env var in mocks and verify new default
- Add env var to .env.example files and deployment docs

* fix: address PR review comments

- Clarify Vercel Blob is also a valid production backend (serves via proxy)
- Add per-service S3-compatible path-style guidance (R2 vs B2 vs Spaces)
- Make first resolve-blob-uris test explicitly set its mock (test isolation)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* chore: reset lockfile from main to minimize resolution drift

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: pin s3-request-presigner to match client-s3 to prevent lockfile drift

Pin @aws-sdk/s3-request-presigner to 3.995.0 (same as resolved client-s3)
to minimize pnpm-lock.yaml changes and prevent react version mismatch
that caused agents-email test failures in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Resolve blob storage provider once per message list instead of per message

Addresses PR feedback: call getBlobStorageProvider() once in
resolveMessagesListBlobUris and pass the provider through to
resolveMessageBlobUris, avoiding N singleton lookups per conversation
retrieval.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* chore: reset lockfile from main and reinstall to fix CI

Reset pnpm-lock.yaml from main per repo guidelines to prevent
resolution drift that was causing monaco-editor ESM import failures
in agents-manage-ui tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Address remaining review suggestions: list-level presigned URL test and AWS CLI prerequisite

- Add test for resolveMessagesListBlobUris with presigned URLs active
  across multiple messages, covering Promise.all handling
- Add AWS CLI prerequisite note to S3 setup docs

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* Remove AWS CLI prerequisite note from S3 docs

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>

* ci: add preview janitor and recreate control (#2930)

* ci: add preview state janitor and recreate path

* ci: simplify preview janitor and var resolution

* ci: address preview janitor review feedback

* ci: gate preview auth on SpiceDB deployment readiness

* ci: tighten preview bootstrap retry budget

* ci: retry preview recreate after Railway delete

* ci: clarify skipped preview workflow jobs

* Rename headers in schema and usage to hyphen format (#2962)

* Version Packages (#2952)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrew Mikofalvy <[email protected]>

* Update actions/setup-node and pnpm/action-setup to Node.js 24 versions (#2963)

Upgrade actions/setup-node from v4 to v6.3.0 and pnpm/action-setup from
v4 to v5.0.0 across all workflows to resolve the Node.js 20 deprecation
warning. Node.js 20 actions will be forced to Node.js 24 starting June 2, 2026.

https://claude.ai/code/session_01D5Ah1eAYvZCS2SfZ5Lopi3

Co-authored-by: Claude <[email protected]>

* credential id reference added (#2967)

* Add minimumReleaseAgeExclude for @inkeep/* packages (#2968)

Excludes @inkeep scoped packages from the 1440-minute minimum release age
gate so our own published packages can be installed immediately after release.

https://claude.ai/code/session_01LBEnpfsjj6r4cdwXs2VeHx

Co-authored-by: Claude <[email protected]>

* add TooltipProvider

* add back timeout

* should fix tests

* polish

* fix

* pnpm i

* upd

---------

Co-authored-by: Varun Varahabhotla <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Varun Varahabhotla <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: bryan-inkeep <[email protected]>
Co-authored-by: Gaurav Varma <[email protected]>
Co-authored-by: robert-inkeep <[email protected]>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Andrew Mikofalvy <[email protected]>
Co-authored-by: Andrew Mikofalvy <[email protected]>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-authored-by: inkeep-internal-ci[bot] <259778081+inkeep-internal-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant