Skip to content

feat: add NWB community - #517

Merged
neuromechanist merged 2 commits into
OpenScience-Collective:developfrom
bendichter:feature/issue-514-nwb-community
Sep 25, 2026
Merged

neuromechanist merged 2 commits into
OpenScience-Collective:developfrom
bendichter:feature/issue-514-nwb-community

Conversation

@bendichter

Copy link
Copy Markdown
Contributor

Refs #514 (section 1).

Summary

Adds src/assistants/nwb/config.yaml for an NWB Assistant, to replace the separately maintained assistant currently embedded in the PyNWB docs.

  • Documentation: 105 PyNWB, HDMF, NeuroConv and NWB Inspector pages from magland/nwb-doc-index, the index the current NWB Assistant uses. Each entry keeps the index's URL and description, and source_url points to the raw .py/.rst file on GitHub. Two entries whose sources no longer exist were dropped, and recording/maxone now points to its renamed page, recording/maxwell.
  • Preloaded: PyNWB "NWB File Basics" and NeuroConv "Data Interfaces", the overview pages that underlie most questions. Everything else is fetched on demand.
  • System prompt: adapted from the current NWB Assistant's prompt, with OSA's placeholders.
  • Widget: title, greeting and suggested questions, cors_origins for pynwb.readthedocs.io and nwb.org, page context enabled, and a budget of $5/day and $50/month.
  • Model: platform-funded claude-haiku-4-5 for now. We plan to switch to GPT-6 Luna once it's offered through Bedrock, as discussed in NWB community: support for a self-funded OpenRouter deployment (key, model choice, doc fetching fixes) #514.
  • Not yet enabled: GitHub, docstring, Discourse and citation sync. This first version matches the current assistant's knowledge sources; we'll add those in follow-ups.

Evaluation

Before proposing this, we compared this config with the current NWB Assistant on 25 NWB questions, with the same model (GPT-6 Luna), the same docs and equivalent prompts, graded blind. With the clean_markdown fix from #514 section 4 (being worked on by @kabilansri2008-gif), OSA scored highest in both runs we did: 4.44 and 4.41 out of 5, against 4.20 for the current assistant. It also made the fewest false API claims. All of this config's sources are raw RST/Python, so that fix matters for NWB in particular.

Tests

  • osa validate src/assistants/nwb/config.yaml passes.
  • pytest tests/test_assistants/test_community_yaml_generic.py -k nwb -m "": 17 passed, 3 skipped (no GitHub repos or DOIs are configured yet). This includes the network test that every source_url returns 200.
  • pytest -m "not network": 3002 passed. Excluded are tests that also fail on develop without this change in my environment: tests/test_frontend/test_workspace_export.py and one NEMAR runtime test need bun, and five tests in tests/test_integration/test_llm.py fail with AttributeError: module 'src.cli.main' has no attribute '_server_started'.
  • Smoke test on a local server: GET /nwb returns the widget config, and /nwb/ask answers using retrieve_nwb_docs. I tested with an OpenRouter BYOK key, since I don't have a platform key.

Adds the NWB Assistant community: 105 PyNWB, HDMF, NeuroConv and NWB
Inspector docs from magland/nwb-doc-index (2 preloaded), a system
prompt adapted from the existing NWB Assistant, widget settings, and
CORS origins for the NWB docs sites. Platform-funded Haiku default for
now; GPT-6 Luna once it is offered through Bedrock.

Refs OpenScience-Collective#514
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@neuromechanist neuromechanist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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