Skip to content
KnockDevelopers

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.

Chat with a Developer

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:

  1. Your site's origin allowed. Your website's domain and all its subdomains over https are allowed already (for https://www.acme.com: acme.com, www.acme.com, app.acme.com…). If your poppy.json is on another domain, send that origin to your Knock contact. It must be https with no port.
  2. 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

poppy.json
{
  "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"
      }
    ]
  }
}
FieldValue
protocol_version"1.0"
organization.nameYour company name, as a buyer knows it.
organization.domainThe host that serves this file: lowercase, with no scheme and no path.
agent.protocols[].type"poppy"
agent.protocols[].endpointhttps://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[].descriptionOne 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.com to www.acme.com. Do not redirect to a host you do not own.
  • organization.domain must 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 own organization.domain.

Most hosts serve a folder of static files. Put the file in that folder, under .well-known:

.well-known/poppy.json

Some 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-resource

It 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

Check the two 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-resource

The first command prints status 200 and your JSON. The second prints 404.

What happens in a chat

  1. A buyer asks their AI assistant about your product. The AI assistant reads your poppy.json and starts a chat on your endpoint.
  2. Your Knock AI agent answers, as it does on your website. It can offer a link to book a meeting.
  3. Knock creates a lead. The lead's source is the AI assistant: AI Search with the AI assistant's name for the well-known ones, or Referral with the AI assistant's host for any other.
  4. Your rep gets the card in Slack. The card's chat link is the magic link you chose.
  5. 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:

TopicBehaviour
SessionsSigned out only. A session with a sign-in token is refused.
ReadsJSON long-poll. Send wait: a read is held for at most 25 seconds. There is no streaming.
ConversationsOne per AI assistant, buyer and endpoint. A second start returns the same conversation.
StateRead working, handoff, responder and closed from each response. There are no state events.
Message idsA message your AI assistant sent comes back with its request id as message.id.
Asking for a personThe 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.
Closingclosed 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 limitsStatus 429 with rate_limited and a Retry-After header.
RetriesSend 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 seeLikely cause
AI assistants do not find youThe 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_sessionThe host that serves your poppy.json is not on your website's domain. Send its origin to your Knock contact.
Every request answers not_foundThe magic link ID in endpoint is wrong, or AI assistant chats are switched off for your account.
Chat with a Developer

On this page