Skip to content

AA-153020 [ai-sdk] document Personal Agent Protocol traffic and the personal_agent message source - #155

Merged
vinaygoel merged 6 commits into
mainfrom
vinaygoel/AA-153020-personal-agent-protocol
Nov 20, 2026
Merged

vinaygoel merged 6 commits into
mainfrom
vinaygoel/AA-153020-personal-agent-protocol

Conversation

@vinaygoel

@vinaygoel vinaygoel commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds guidance for Personal Agent Protocol ("Poppy") traffic in Agent Analytics. A company (the Amplitude customer) runs its own customer-facing agent; a user's personal agent (an AI acting for the user) talks to it through Personal Agent Protocol. Agent Analytics records, per message, whether a person or an AI wrote it. No new public SDK API: docs and catalog text only.

Data convention:

  • [Agent] Message Source on [Agent] User Message: user for the user's own words (author.type: "human"), new personal_agent for text an AI wrote on the user's behalf (author.type: "agent", spec 8.8). agent keeps meaning delegation inside the customer's own system and is not used for this traffic.
  • human_agent on [Agent] AI Response when a person at the company wrote the reply after a handoff (spec 8.9), sent over the HTTP API or integrations; the SDK doesn't set it.
  • [Agent] Context: poppy_personal_agent = Session JWT iss, poppy_session_id = sid, poppy_agent_id = optional agent_id.
  • [Agent] Session ID = the Conversation ID the company chose (spec 8.2), like every other integration guide uses the platform's conversation ID. A Personal Agent Protocol Session spans browsing, API calls and several conversations, and a conversation can continue in a new Session, so sid is context, not the session ID.
  • Identity: device_id = poppy-sha256: + SHA-256 of iss and sub (sub is unique only within one personal agent; same shape as the voice guides' callerDeviceId), and user_id only after sign-in, so Amplitude merges the anonymous events into the account (Merged users). sub is never the user_id.
  • The company verifies the Poppy-Session header; Amplitude code never verifies JWTs.

Changes:

  • New docs/integrations/personal-agent-protocol.md: roles, field mapping, a typed SDK example, sign-in identity, funnel product events, website join, OpenTelemetry attributes, chart recipes.
  • manifest.json: new protocols key (a protocol is not a hosted platform, and the platforms list carries forwarder-core contract tests). The generator renders it into AGENTS.md and llms.txt. Also listed in the integrations README.
  • Sierra, Fin and Agentforce guides: short "Personal agent traffic" section linking to the guide. It puts the Poppy keys in the conversation context, which the forwarder core already sends as [Agent] Context; only Message Source needs adapter work. Whether each platform's export exposes the protocol fields is stated as unverified.
  • [Agent] Message Source catalog description (byte-identical to the Python catalog) and messageSource JSDoc now list personal_agent.
  • CHANGELOG entry under Unreleased. No version bump.

Agent Analytics owners: please confirm the new personal_agent Message Source value (an AI writing on the end user's behalf).

Companion PRs

Test plan

  • New test/docs-personal-agent-protocol.test.ts: type-checks the guide's example against src, runs it to check Message Source / session / user / context, checks the manifest entry, README / AGENTS.md / llms.txt links, the platform-guide sections, and the exact catalog description.
  • npx vitest run: all pass except four tests that hit the 5s timeout under a load average of ~130 (smoke, hook-cursor, langchain, providers/base); they pass rerun with a longer timeout.
  • npx tsc --noEmit, pnpm -s lint, pnpm -s check:generated, pnpm -s check:catalog

…ersonal_agent message source

Add docs/integrations/personal-agent-protocol.md: when a user's personal
agent talks to the company's agent through Personal Agent Protocol, send
[Agent] Message Source = personal_agent for user turns an AI wrote and
user for the user's own words, poppy_personal_agent / poppy_agent_id as
context, poppy-<sid> as the session ID, and sub as the user ID until
sign-in. Includes a typed SDK example, funnel events, website join,
OpenTelemetry attributes and chart recipes.

List it under a new protocols key in manifest.json, the integrations
README, AGENTS.md and llms.txt. Link it from the Sierra, Fin and
Agentforce guides. Update the Message Source catalog description and
messageSource JSDoc to include personal_agent. No new SDK API.

Co-authored-by: Cursor <cursoragent@cursor.com>
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

AA-153020

@vinaygoel
vinaygoel marked this pull request as ready for review November 20, 2026 00:08
@vinaygoel
vinaygoel requested a review from a team as a code owner November 20, 2026 00:08
vinaygoel and others added 5 commits November 19, 2026 16:28
…context

Co-authored-by: Cursor <cursoragent@cursor.com>
…D until sign-in

Send poppy- + sub as device_id and set user_id only after sign-in, so Amplitude merges pre-sign-in turns into the account. Sending sub as user_id would leave them on a separate user.

Co-authored-by: Cursor <cursoragent@cursor.com>
…sonal agent

sub is unique only within the personal agent that assigned it, so hash iss and sub together; otherwise two personal agents' users could merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
…sation ID

A Personal Agent Protocol Session spans browsing, API calls and several conversations, and a conversation can continue in a new Session. Use the company's Conversation ID as [Agent] Session ID and keep sid as poppy_session_id context for funnel joins.

Co-authored-by: Cursor <cursoragent@cursor.com>
…th the other integration guides

Use the voice guides' hashed device ID shape (poppy-sha256:), their identity wording and link Amplitude's merged-users doc. The Sierra, Fin and Agentforce forwarder cores already send conversation context as [Agent] Context, so only Message Source needs adapter work.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vinaygoel
vinaygoel merged commit 5a1920e into main Nov 20, 2026
9 checks passed
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