Skip to content

Add the NWB Assistant chat widget to the docs - #1587

Open
bendichter wants to merge 3 commits into
hdmf-dev:devfrom
bendichter:nwb-assistant-widget
Open

bendichter wants to merge 3 commits into
hdmf-dev:devfrom
bendichter:nwb-assistant-widget

Conversation

@bendichter

@bendichter bendichter commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Adds the NWB Assistant chat widget to these docs. The assistant is hosted by the
Open Science Assistant (OSA) as its nwb community
(OpenScience-Collective/osa#514). It answers questions about NWB, PyNWB, HDMF, NeuroConv, NWB Inspector, MatNWB
and DANDI from their documentation, and links the pages it used. OSA's maintainers host and fund it, so these docs
no longer depend on a separately maintained assistant.

In a blind-graded comparison on 25 NWB questions, OSA's NWB assistant scored higher than the current NWB
Assistant and made fewer false claims about the APIs.

The change is two lines in conf.py's html_js_files: OSA's widget script, and _static/js/nwb_assistant.js,
which selects the NWB assistant before the widget initializes.

How to test the behavior?

Build the docs and open any page: a chat button appears in the bottom-right corner and opens the NWB Assistant.

cd docs/source && sphinx-build -b html . _build/html && python -m http.server -d _build/html 8000
# open http://localhost:8000: the widget loads with the title "NWB Assistant"

On localhost the widget uses OSA's development backend. On *.readthedocs.io it uses OSA's production backend,
where the NWB Assistant has been available since OSA v0.8.16,
which also allows this docs site to use the widget.

I checked the production path in headless Chromium with a test page served as https://hdmf.readthedocs.io that loads the
same two scripts: the widget loaded the nwb community from OSA's production backend. From a page served as https://pynwb.readthedocs.io, it also answered a question and cited the PyNWB docs page it used. Read the Docs PR
previews (*.readthedocs.build) are not on OSA's allowlist, so the widget won't answer there.

Checklist

  • The PR description explains the problem and the solution.
  • No other open PRs make the same change.
  • Changelog entry added.

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (d1bf840) to head (1e1cd64).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1587   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          41       41           
  Lines       10305    10305           
  Branches     2133     2133           
=======================================
  Hits         9601     9601           
  Misses        423      423           
  Partials      281      281           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

2 participants