Skip to main content
Start your model’s system prompt, the text it reads before every conversation, with Agentcard’s instructions. Your model then tells the shopper what Agentcard can buy in Agentcard’s own words, sends every shopping request to the buy tool, and never confirms a cart the shopper only liked.

Know what the instructions teach

  • What Agentcard can do: buy from Amazon, Walmart, Target, Best Buy and thousands more stores, plan a whole trip, order food delivery and book restaurant tables. The model never says whether a store the shopper names is supported. It calls the buy tool, which knows.
  • How to ask: the model passes the shopper’s words to the tool as they said them, and asks for one thing per message, the step next_action names.
  • Links: the model never writes a link your app already shows, and says a link is waiting instead.
  • Confirming: the model confirms a cart only on the shopper’s yes to that cart. “Looks good” is interest, not a yes.
  • Writing: the model matches the shopper’s tone and keeps ids, hashes and tokens out of the chat.

Load the instructions

Agentcard’s text changes from one release to the next, so log which version each conversation used.
appInstructions() returns the text as a string, from inside the package, with no request. Use it as your system prompt, with the buy tool beside it:
agent.ts
sendLink hands your app each link, as Send each link shows. APP_INSTRUCTIONS_VERSION names the version of the text. A new SDK release can bring new text, which your app picks up when you update the package.

Say how your app shows text

Tell your model whether your app shows Markdown, the formatting that turns **bold** and | a | b | into bold text and tables. In an app that shows Markdown, a shopper who asks for a table gets a table. In an app that shows plain text, such as an SMS chat, the model writes no Markdown and starts each list line with • .
Pass markdown: true when your app shows Markdown, and leave it out for plain text. Pass textingStyle: true when your app is a chat that writes in lowercase, the way a person texts, with the same value you pass to buyTool, so the model’s words and Agentcard’s read alike.
agent.ts

Add your own lines

Write your own lines after Agentcard’s, and keep them about your app, such as its name or the current date. Leave out lines about which stores Agentcard reaches, which Agentcard’s text covers as it adds stores. A line of your own that says “most online stores” contradicts Agentcard’s, and the shopper then reads two different answers in one chat.
Leave out lines about formatting too: markdown and textingStyle set it, and a line such as “no markdown” contradicts them.
agent.ts