Repository navigation
Linking to the AI assistant
You can link to a docs page so that the Chainguard AI Assistant opens as soon as the page loads. Use these links to send readers straight to the assistant from an email, a Slack message, or another site. The assistant is a Kapa.ai widget, and Kapa doesn't provide a URL of its own that opens it.
Add ask-ai to the query string of any URL under www.chainguard.dev/docs:
| URL | What happens |
|---|---|
https://www.chainguard.dev/docs?ask-ai |
The assistant opens. |
https://www.chainguard.dev/docs?ask-ai&q=How+do+I+get+started |
The assistant opens with the question filled in. The reader decides whether to send it. |
https://www.chainguard.dev/docs?ask-ai&q=How+do+I+get+started&submit |
The assistant opens and sends the question. |
Keep these rules in mind:
- Any docs page works, not only the home page. For example,
https://www.chainguard.dev/docs/chainguard/libraries/introduction?ask-aiopens the assistant on the Chainguard Libraries introduction. - Encode spaces in the question as
+or%20. -
submithas no effect withoutq. The assistant opens with an empty question box.
Sending the question is opt-in for each link. Use submit only in links your team controls, such as a campaign email. Without submit, the reader sees the question and chooses whether to send it, so a link that someone else writes can't make the assistant answer a question the moment the page opens.
Each click on a link with submit sends its question to the assistant, and the question appears in the assistant's analytics like one a reader typed. Before you send such a link widely, tell the Docs Team in the #docs Slack channel which question it sends.
assets/js/kapa-deep-link.js reads the page's query string and calls the open() function from Kapa's JavaScript API. layouts/partials/head/script-header.html loads the script in the page head, before the Kapa widget script. The script uses Kapa's preinitialization snippet, which queues the open() call until the widget finishes loading. edu#4450 added the feature.
Links to these URLs already exist outside the docs. Before you remove the script, rename its parameters, or replace the Kapa widget, ask in #docs. Otherwise, those links still load the page, but the assistant doesn't open.
If you have any questions or suggestions regarding our Style Guide, please create an issue and we will follow up accordingly.