Skip to content

Replace the docs assistant with the OSA NWB Assistant widget - #2266

Open
bendichter wants to merge 2 commits into
NeurodataWithoutBorders:devfrom
bendichter:nwb-assistant-widget
Open

bendichter wants to merge 2 commits into
NeurodataWithoutBorders: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. It replaces the "Open Assistant" button on the docs home page, which opens the previous assistant (nwb-assistant.neurosift.app) in an iframe, and removes its CSS (_static/css/nwb_assistant.css) and the raw HTML in index.rst. The new widget appears on every page, not just the home page.

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://pynwb.readthedocs.io that loads the
same two scripts: the widget loaded the nwb community from OSA's production backend and answered a question, citing 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 96.17%. Comparing base (ef74c16) to head (6309881).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2266   +/-   ##
=======================================
  Coverage   96.17%   96.17%           
=======================================
  Files          30       30           
  Lines        3003     3003           
  Branches      437      437           
=======================================
  Hits         2888     2888           
  Misses         65       65           
  Partials       50       50           
Flag Coverage Δ
integration 75.02% <ø> (ø)
unit 86.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@bendichter

Copy link
Copy Markdown
Contributor Author

@rly , @oruebel , can one of you please test this and approve?

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.

1 participant