Skip to content

feat(assistant): add the in-page AI assistant to docs.celo.org (#2250) - #2286

Open
GigaHierz wants to merge 3 commits into
mainfrom
GigaHierz/issue-2250-options
Open

feat(assistant): add the in-page AI assistant to docs.celo.org (#2250)#2286
GigaHierz wants to merge 3 commits into
mainfrom
GigaHierz/issue-2250-options

Conversation

@GigaHierz

@GigaHierz GigaHierz commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes the implementation half of #2250. The research, comparison table and decision are recorded on the issue.

What this adds

  • assistant.js — a loader that injects the assistant widget on every page. Mintlify includes every .js file in the content directory site-wide but doesn't support a raw <script src> in MDX, so the tag is created programmatically.
  • use-docs-with-ai.mdx — documents the Ask AI button alongside the existing MCP / llms.txt entry points.

The widget and its API live in celo-org/docs-ai-assistant, deliberately outside this repo — any .js committed here is injected into the live site.

How it works

There is no second content pipeline. The backend answers using the Mintlify-hosted MCP endpoint at docs.celo.org/mcp, which is reindexed on every docs deploy, so the assistant can never serve a stale index. Citations come free because the MCP search tool returns page URLs.

Models are Haiku 4.5 by default with a Sonnet 5 escalation when an answer cites nothing.

Verified against the live deployment

Check Result
Answer quality Grounded, 8.3s, citations resolve 200
Escalation path Sonnet 5, 4 citations
Off-topic question Refuses rather than guessing
Origin allowlist Non-docs origins get 403
Rate limiting Exactly 15 requests / 10 min per IP, then 429
submit_feedback MCP tool Denylisted — not exposed to the model
Dependencies 0 vulnerabilities

Before merging

The assistant currently runs on a temporary, rate-limited OpenRouter key for testing. Merging puts the widget on every docs page, so the sequence should be:

  1. Swap in a dedicated API key with a monthly spend cap.
  2. Point WIDGET_SRC at docs-assistant.celo.org once IT creates the CNAME (currently the Vercel URL — a one-line change).

Merging also confirms the last open question: whether content-directory JS injection works on our Mintlify plan. The pricing table and the already-injected style.css both say yes, but preview deployments are Pro-gated, so production is the only conclusive test. Open any page's console and look for the widget.

🤖 Generated with Claude Code

Trivial marker script to confirm Mintlify's content-directory JS
injection works on the current plan before building the real widget
loader.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@GigaHierz
GigaHierz marked this pull request as ready for review August 25, 2026 14:33
@GigaHierz
GigaHierz requested a review from a team as a code owner August 25, 2026 14:33
@GigaHierz
GigaHierz requested a review from palango August 25, 2026 14:53
GigaHierz and others added 2 commits August 26, 2026 09:19
Replaces the injection-test marker with the real loader. The widget is
served from the assistant deployment and answers from the docs MCP
endpoint with links back to the pages it used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds the Ask AI button to the entry-point table and a short section
covering what it answers from, that it cites its sources, and that
uncited gaps feed back into what gets written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@GigaHierz GigaHierz changed the title test(assistant): verify custom JS injection on current Mintlify plan (#2250) feat(assistant): add the in-page AI assistant to docs.celo.org (#2250) Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant