Repository navigation
AA-153020 [ai-sdk] document Personal Agent Protocol traffic and the personal_agent message source - #155
Merged
Conversation
…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>
vinaygoel
marked this pull request as ready for review
November 20, 2026 00:08
…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>
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
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 Sourceon[Agent] User Message:userfor the user's own words (author.type: "human"), newpersonal_agentfor text an AI wrote on the user's behalf (author.type: "agent", spec 8.8).agentkeeps meaning delegation inside the customer's own system and is not used for this traffic.human_agenton[Agent] AI Responsewhen 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 JWTiss,poppy_session_id=sid,poppy_agent_id= optionalagent_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, sosidis context, not the session ID.device_id=poppy-sha256:+ SHA-256 ofissandsub(subis unique only within one personal agent; same shape as the voice guides'callerDeviceId), anduser_idonly after sign-in, so Amplitude merges the anonymous events into the account (Merged users).subis never theuser_id.Poppy-Sessionheader; Amplitude code never verifies JWTs.Changes:
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: newprotocolskey (a protocol is not a hosted platform, and theplatformslist carries forwarder-core contract tests). The generator renders it intoAGENTS.mdandllms.txt. Also listed in the integrations README.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 Sourcecatalog description (byte-identical to the Python catalog) andmessageSourceJSDoc now listpersonal_agent.Agent Analytics owners: please confirm the new
personal_agentMessage Source value (an AI writing on the end user's behalf).Companion PRs
Test plan
test/docs-personal-agent-protocol.test.ts: type-checks the guide's example againstsrc, 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