Skip to content

Add Open Science Assistant chat widget#912

Open
neuromechanist wants to merge 2 commits intofieldtrip:masterfrom
neuromechanist:add-osa-widget
Open

Add Open Science Assistant chat widget#912
neuromechanist wants to merge 2 commits intofieldtrip:masterfrom
neuromechanist:add-osa-widget

Conversation

@neuromechanist
Copy link

@neuromechanist neuromechanist commented Mar 12, 2026

Summary

Adds the Open Science Assistant (OSA) chat widget to all pages on fieldtriptoolbox.org. The widget provides an AI assistant trained on FieldTrip documentation, tutorials, FAQs, and codebase docstrings.

The widget appears as a small chat button in the bottom-right corner. Users can ask questions about FieldTrip usage, preprocessing, source analysis, statistics, and more. Responses are grounded in official FieldTrip documentation and cite sources with links.

What it does

  • Loads the OSA widget script from demo.osc.earth
  • Configures it with communityId: 'fieldtrip'
  • Widget auto-fetches theme color, title, suggested questions from the OSA backend
  • Appears on every page via the _includes/footer file

Technical details

  • Single file change: _includes/footer (appends 10 lines after the anchor.js block)
  • No changes to existing functionality
  • Widget is ~50KB, loaded asynchronously
  • CORS is already configured on the OSA backend for www.fieldtriptoolbox.org and fieldtriptoolbox.org

Preview

The same widget is already live on other community sites (hedtags.org, eeglab.org, bids.neuroimaging.io, nemar.org, mne.tools).

Test plan

  • Verify widget loads on fieldtriptoolbox.org after merge
  • Verify chat responses reference FieldTrip documentation correctly
  • Verify widget does not interfere with existing page layout or navigation

Tip

To test the Assistant, please use https://demo.osc.earth/fieldtrip. FieldTrip Assistant won't work if the request is sent from domains other than fieldtrip.org and demo.osc.earth. To change this behavior, or any other settings of the FieldTrip Assistant, you are more than welcome to open an issue/PR to update https://github.com/OpenScience-Collective/osa/blob/main/src/assistants/fieldtrip/config.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant