Personal agents (Poppy)
Let a buyer's AI assistant chat with your Knock AI agent. You publish one file on your own domain, and the chat arrives in Knock like a website chat.
An AI assistant acts for one person: the protocol calls it a personal agent. Knock supports the Personal Agent Protocol 1.0, known as Poppy. With it, a buyer's AI assistant can chat with your Knock AI agent with no browser.
The AI assistant finds you through a file on your own domain, poppy.json. The chat it starts is the same chat as on your website. Your AI agent answers, Knock creates a lead, and your rep gets the card in Slack and can take over. The lead's source is the AI assistant the buyer used.
Before you start
You need two things:
- Your site's origin allowed. Your website's domain and all its subdomains over
httpsare allowed already (forhttps://www.acme.com:acme.com,www.acme.com,app.acme.com…). If yourpoppy.jsonis on another domain, send that origin to your Knock contact. It must behttpswith no port. - A magic link ID. The chat runs on a magic link. Use a link made only for AI assistants, and use its ID, not its URL. The link's name shows on the rep's card, so a name like "AI assistants" tells the rep where the lead came from.
Publish poppy.json
Write the file
{
"protocol_version": "1.0",
"organization": {
"name": "Acme",
"domain": "acme.com"
},
"agent": {
"protocols": [
{
"type": "poppy",
"endpoint": "https://app.knock-ai.com/v1/poppy/YOUR_MAGIC_LINK_ID",
"description": "Ask about Acme's product, pricing and demos"
}
]
}
}| Field | Value |
|---|---|
protocol_version | "1.0" |
organization.name | Your company name, as a buyer knows it. |
organization.domain | The host that serves this file: lowercase, with no scheme and no path. |
agent.protocols[].type | "poppy" |
agent.protocols[].endpoint | https://app.knock-ai.com/v1/poppy/ followed by your magic link ID. Keep the host as it is: an AI assistant signs the URL it calls. |
agent.protocols[].description | One sentence that tells an AI assistant what it can ask you. |
Do not add an auth block. Knock offers no sign-in for AI assistants.
Serve it from your own domain
The file must answer at exactly this path:
https://acme.com/.well-known/poppy.json- Serve it as JSON, with status 200.
- Serve it from your domain. A redirect to another host of yours is fine, for example from
acme.comtowww.acme.com. Do not redirect to a host you do not own. organization.domainmust be the host that answers with the file, after any redirect. If two hosts each answer with the file and neither redirects, each needs its own file with its ownorganization.domain.
Most hosts serve a folder of static files. Put the file in that folder, under .well-known:
.well-known/poppy.jsonSome hosts hide folders that start with a dot. Check the URL after you deploy.
Answer 404 for the sign-in metadata
An AI assistant also reads this URL, to learn if you have a sign-in for AI assistants:
https://acme.com/.well-known/oauth-protected-resourceIt must answer 404. A 404 tells the AI assistant there is no sign-in, and it continues. Any other answer makes the AI assistant stop: a redirect, a 200 with your home page, or a timeout.
Check single-page apps
Many sites send every unknown path to the home page with status 200. If yours does, add a rule so this one path answers 404.
Check both URLs
curl -i https://acme.com/.well-known/poppy.json
curl -s -o /dev/null -w "%{http_code}\n" https://acme.com/.well-known/oauth-protected-resourceThe first command prints status 200 and your JSON. The second prints 404.
What happens in a chat
- A buyer asks their AI assistant about your product. The AI assistant reads your
poppy.jsonand starts a chat on your endpoint. - Your Knock AI agent answers, as it does on your website. It can offer a link to book a meeting.
- Knock creates a lead. The lead's source is the AI assistant:
AI Searchwith the AI assistant's name for the well-known ones, orReferralwith the AI assistant's host for any other. - Your rep gets the card in Slack. The card's chat link is the magic link you chose.
- When your rep replies in the card's thread, the AI assistant gets the reply as a message from a person, and your AI agent stops answering in that chat.
The buyer stays anonymous until they give their details, for example when they book a meeting.
For AI assistant developers
The endpoint follows Poppy 1.0, with these limits:
| Topic | Behaviour |
|---|---|
| Sessions | Signed out only. A session with a sign-in token is refused. |
| Reads | JSON long-poll. Send wait: a read is held for at most 25 seconds. There is no streaming. |
| Conversations | One per AI assistant, buyer and endpoint. A second start returns the same conversation. |
| State | Read working, handoff, responder and closed from each response. There are no state events. |
| Message ids | A message your AI assistant sent comes back with its request id as message.id. |
| Asking for a person | The request is stored as a message from the buyer, and handoff reads pending until a rep answers, you withdraw the request, or the conversation closes. A rep answers in the same conversation. |
| Closing | closed reads true, and a later message answers 409 with conversation_closed. A new start by the same buyer opens the same conversation again. |
| Errors | { "error": "<code>" }, with the protocol's codes. |
| Rate limits | Status 429 with rate_limited and a Retry-After header. |
| Retries | Send the request again with the same id. A retry within 10 minutes is not stored twice. A retry that arrives while its first copy is still being stored also answers 429, with Retry-After: 1. |
Read with the cursor of the last response, and keep reading while working is true.
Troubleshooting
| What you see | Likely cause |
|---|---|
| AI assistants do not find you | The file is not at /.well-known/poppy.json, or organization.domain is not the host that answers with the file after any redirect. |
| An AI assistant reads the file and then stops | /.well-known/oauth-protected-resource does not answer 404. |
Every request answers invalid_session | The host that serves your poppy.json is not on your website's domain. Send its origin to your Knock contact. |
Every request answers not_found | The magic link ID in endpoint is wrong, or AI assistant chats are switched off for your account. |