Skip to content

Add OSA chat widget to documentation#13702

Open
neuromechanist wants to merge 2 commits intomne-tools:mainfrom
neuromechanist:add-osa-chat-widget
Open

Add OSA chat widget to documentation#13702
neuromechanist wants to merge 2 commits intomne-tools:mainfrom
neuromechanist:add-osa-chat-widget

Conversation

@neuromechanist
Copy link
Contributor

Summary

  • Adds the Open Science Assistant (OSA) chat widget to the MNE-Python documentation
  • The widget provides an AI assistant specialized in MNE-Python that can help users with MEG, EEG, and neurophysiological data analysis questions
  • Loads the widget script from the OSA CDN and configures it with 3 suggested questions

Details

The widget is a lightweight floating chat button that appears on all documentation pages. It:

  • Uses the mne community configuration from OSA
  • Shows 3 suggested starter questions relevant to MNE-Python users
  • Supports page context awareness (sends current page URL to help provide contextually relevant answers)
  • Is non-intrusive; users can dismiss or ignore it

The widget is served from demo.osc.earth and configured via the communityId: 'mne' setting, which auto-configures the API endpoint, title, theme color, and initial greeting.

Test plan

  • CORS origins for mne.tools and *.mne.tools are enabled on the OSA backend
  • Verify widget loads on local Sphinx build (make html)
  • Verify chat responses work end-to-end
  • Check widget appearance on mobile viewports

@welcome
Copy link

welcome bot commented Feb 27, 2026

Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴

@neuromechanist
Copy link
Contributor Author

Hi maintainers! Could someone approve the CircleCI pipeline? It requires maintainer approval for first-time contributors from forks.

Also, if you'd like to customize the widget further (e.g., adding your own logo), you can pass additional options to OSAChatWidget.setConfig(). For example:

OSAChatWidget.setConfig({
  communityId: 'mne',
  logo: 'https://mne.tools/stable/_static/mne_logo.svg',
  suggestedQuestions: [...]
});

Full configuration reference: https://docs.osc.earth/osa/deployment/widget/#full-configuration

@@ -0,0 +1 @@
Add OSA chat widget to documentation pages, by `Yahya Shirazi`_. No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neuromechanist you need to add your name somewhere as sphinx does not recognize the target Yahya Shirazi

maybe in authors.rst but I don't know what's the recommended way today

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name would need to be added to doc/changes/names.inc, then in the changelog entry you should link it as :newcontrib:`Yahya Shirazi`. (note the missing underscore).

@tsbinns
Copy link
Contributor

tsbinns commented Feb 28, 2026

@neuromechanist Thanks for opening this PR. Pushing AI tools is not something that everyone has been fully comfortable with. See for instance this discussion regarding an MCP: #13288 (comment).

If I undestand, OSA is more of a chatbot, but still those concerns over the correctness of the bot's answers would apply. One of the suggested prompts 'How do I filter and preprocess my data?' is such an enormous and nuanced question. Others may feel differently, but that's my concern.

And yes, while nobody has to use it, it's inclusion in the documentation is still implicit support that it's answers can be trusted.

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.

3 participants