Repository navigation
Description
Hi all,
AI assistants and MNE keep coming up, both here and on the forum. I went back through the earlier discussions and wanted to suggest something concrete that I think addresses the concerns raised there.
What's been discussed so far
- Showcase Intelligent AI-Driven MCP (Model Context Protocol) EEG Server Using MNE-Python #13288: the Steering Council decided not to promote an AI-driven MCP server, mainly because we can't vouch for the correctness of what these tools produce.
- MCP server for mne-python #13592: still-open question about an MCP server for MNE.
- Add OSA chat widget to documentation #13702: the OSA chat widget PR. @cbrnr's BDF status channel example showed a confidently wrong answer, Kapa came up as an alternative, and @wmvanvliet raised the point about not putting MNE branding on something we haven't vetted.
- The forum thread (https://mne.discourse.group/t/ai-agents-to-work-with-mne/11744): Maximilien suggested starting with
.mdskills/rules and asked for volunteers, and Daniel Borek pointed to how PyMC and marginaleffects did this in separate repos. Community skills are already appearing too, e.g. ClaudeEEG (announced on the forum in April), which bundles a copy of our tutorials, but as far as I can tell none of these have been reviewed or measured for correctness. - On the developer side, AGENTS.md is already in place and was recently refined (Update agent guidance [ci skip] #14414), so this would be the user-facing counterpart.
The common thread for me is that nobody can currently say how often these tools are wrong for MNE questions. Our users are already using ChatGPT, Claude, Copilot etc. whether we recommend them or not, so I think measuring that is more useful than adding another tool.
What I'd like to try
- A small benchmark. Real MNE questions (from forum threads and known pitfalls like the BDF status channel, filtering epochs vs. raw, ICA on high-passed data, decoding/CV leakage, choosing an inverse method), each with clear pass/fail criteria checked by someone who knows the topic. Where possible, questions would ask for code that has to run and give a checkable result, rather than free text. Plus a simple script so anyone can rerun it with whatever model they already use. No API cost to the project. This could also give us actual data for deciding on Add OSA chat widget to documentation #13702.
- Reviewed skill files. Plain Markdown notes on MNE best practices and common mistakes, linking back to our tutorials, and only marked stable after someone experienced has reviewed them. The benchmark would show whether they actually help.
- Kept outside core. A separate experimental repo, either under
mne-toolsif people are comfortable with that, or under my account to start with. No new module, no dependency, nothing inmneitself, and no MNE branding on a chat bot.
How I'd go about it
I'd start small, with 20 questions, one draft skill file, and a comparison of 2–3 assistants (with and without existing skills like ClaudeEEG) graded by hand, and post the results here. If that's useful, I'd expand it into a fuller set. I'm happy to do this as volunteer work. If it turns out well and someone is interested in mentoring, it might also make a reasonable GSoC 2027 idea.
Where I'd appreciate your input
- Does this direction sit OK with the Steering Council's earlier position, or are there concerns I'm missing?
mne-toolsrepo or personal repo to start?- If you have favourite "everyone gets this wrong" questions from the forum, I'd love to collect them for the pilot.
Thanks, and no rush on this. I know everyone's bandwidth is limited, so I'd rather get the scope right before starting.
Activity
brovelli commentedon Oct 19, 2026
Very good initiative. I think it would be a good idea for a GSoC 2027 projet. I am open to join if needed.
If it may help for your development, I recently created a Claude Code Plugin called Braina which is expert in brain interaction ananlysis using two packages: Frites (https://github.com/brainets/frites) and HOI (https://github.com/brainets/hoi). Here is the link of Braina, it may give you some ideas of how to structure your projet.
https://github.com/brainets/braina
Note that we are currently testing it. Feedback is more than welcome. And it would be great if we could coordinate the mne-python and/or mne-connectivity agentic tools with Braina.
PragnyaKhandelwal commentedon Oct 21, 2026
Thanks @brovelli, really glad you're interested, and thank you for sharing Braina. I'll look through how it's structured. Coordinating with mne-connectivity is a good idea, since connectivity analysis has a lot of the subtle pitfalls that a benchmark and reviewed skills could cover. I'd be happy to have you involved as the pilot takes shape.
On GSoC: I think that's a lovely idea if the maintainers and community want it, but this doesn't depend on it. I'm happy to start the pilot now as volunteer work, and if it turns out useful, others could build on it later, with or without a GSoC slot.
One more reference I should have linked: @drammock's comment in #13702 asked for exactly this kind of work: generating a set of questions, finding where the tools make mistakes, and using those failures to spot unclear parts of our docs. So I'd add that as an explicit output of the pilot: a list of doc pages that tripped up the assistants, with suggested fixes. That way the work improves the docs for human readers too, regardless of which (if any) AI tool we end up recommending.
@drammock @larsoner @britta-wstnr, since you've been closest to the earlier discussions, I'd value your view on whether this direction (benchmark and reviewed skills outside core) is something you'd be comfortable with, and whether
mne-toolsor a personal repo is the better place to start. I'm glad to begin small either way, and to adjust the scope based on your feedback.tsbinns commentedon Oct 21, 2026
@brovelli @PragnyaKhandelwal If you want to coordinate anything regarding MNE-Connectivity, feel free to tag me, since I'm the main maintainer of that currently
drammock commentedon Oct 21, 2026
thanks for the initiative @PragnyaKhandelwal (and thanks for sharing Braina @brovelli!) We'd like to discuss this in our next steering council meeting, which is late next week. Stay tuned.
PragnyaKhandelwal commentedon Oct 21, 2026
Thank you @drammock and @tsbinns, thanks for bringing this to the Steering Council. I'm happy to adjust the scope to whatever the council is comfortable with. If it's appropriate, I'd also be glad to join the part of the meeting where this is discussed, in case there are questions I can answer directly. If that isn't possible, that's completely fine. Could you let me know the day and time of the meeting either way?
PragnyaKhandelwal commentedon Nov 3, 2026
Hi @drammock, a gentle follow-up on this. I know the Steering Council meeting was due around now, and I'm sure things get busy. If there's any update or feedback on the direction, I'd be glad to hear it, and no worries at all if it needs more time. I'll keep holding off on building until then.
drammock commentedon Nov 3, 2026
thanks for the nudge @PragnyaKhandelwal. We didn't get a full discussion of this at the last SC meeting as some folks were absent. It's high on my list of topics though, so rest assured we will come back to it.
drammock commentedon Nov 6, 2026
@PragnyaKhandelwal we had a chance to talk this over some more. we think the benchmark first (which can then be used to test the influence/improvement from a skills file) is a good approach and encourage you to run with it. For now feel free to use your own repo, you can always transfer it into the mne-tools org later if/when it makes sense to do so.
FWIW, my guess is that initial tests may be quite positive (models are getting better, and if you source the benchmarks from the forum, that's material that the latest models likely already have ingested). But we won't know for sure until we look, and if that happens we can start to branch out into more complex/niche questions to probe the boundaries.
PragnyaKhandelwal commentedon Nov 7, 2026
Thanks @drammock, and thanks to the council for taking the time. I'll start with the benchmark in my own repo, sourcing questions from the forum first, and share a first small set here for feedback before going further. Good point about newer models having likely seen that material. I'll make sure the question set also includes harder and more niche cases so we can see where the limits are.
brovelli commentedon Nov 9, 2026
Dear all,
I will recruit a research assistant who will work on AI tools for neurophysiology and we will be able to give a hand with this project. He will start in Jan 2027 until end of May.
Please keep me in the loop about the work plan and project details. We may be able to contribute.
Cheers
PragnyaKhandelwal commentedon Nov 10, 2026
Hi all, here's a first update on the benchmark. The pilot is done and everything is public: https://github.com/PragnyaKhandelwal/mne-assistant-benchmark
Setup
24 questions: 15 from solved forum threads, plus known pitfalls and one MNE 1.13 version question. For 13 of them, the assistant's code is run automatically on synthetic data and checked. The other 11 are graded by hand against written criteria. I tested three free assistants (Gemini Flash Lite, Claude Sonnet 5.5, ChatGPT free), with one attempt per question in a fresh chat.
Main findings
These patterns came up across all three assistants:
standard_1020/standard_1005) caused 7 of the 23 failures. All three used the old names even when the prompt said "1.13".mean_flipon dSPM question (forum 11491) correctly.The doc pages these point to are collected in
doc_findings.md.Transparency and an ask for help
I want to be upfront about one thing. I used Claude Code to help build the questions and checks, and it also suggested the hand grades. Claude is one of the tested assistants, so that's a real conflict of interest. RESULTS.md lists every decision that affected scores, and the hand grades are marked provisional. I don't think the scores should be read as a ranking anyway, because the differences are within the run-to-run variation I saw.
To make the results trustworthy, I'd really appreciate independent grading from people who know MNE well. There's a blind sheet with the 11 hand-graded questions, where the replies are shuffled and the assistant names are removed: GRADING.md in the repo. Even grading one question helps, and so does feedback on whether the criteria themselves are right.
@brovelli, thank you for the offer, and it's great news about the research assistant. I'll keep you in the loop and share a short work plan for Jan–May here once the next steps are clearer.
Questions for @drammock
doc_findings.mdbe welcome?larsoner commentedon Nov 30, 2026
I don't think we have the bandwidth to grade manually at the moment. I think we can live with the slightly circular Claude-checking-claude for now. I would suggest for example using different models (e.g., Fable or Opus for ground truth, with Opus or Sonnet, respectively, as the one trying to answer questions) as a way to make it slightly more independent.
Is there a way to test some open-source model, i.e., something not paywalled that a user could reasonable run locally on their own system? It would be great to know how these things work on open-source models.
As to the specific questions:
doc_findings.md(I think it's your local file?) but if the idea is that our docs have some errors and / or missing info that should be filled in that improves AI performance, then yes I think small PRs are welcome. We maintainers can view them from the "would this also help end-users" perspective, and I think the answer is likely to be "yes" in most cases, and thus everybody benefits!cbrnr commentedon Nov 30, 2026
I agree with @larsoner. At this point, I think we can (and should) (1) try to make the docs more accessible and correct so that AI can use it more efficiently and (2) evaluate how free open-source models perform (since the latest frontier models by Anthropic and OpenAI perform so well that we don't have to benchmark anything).
brovelli commentedon Nov 30, 2026
Open-source models
Regarding testing open source models, I use OpenCode CLI https://opencode.ai/ where you can test free models (on the cloud) or locally on your PC (if you install them through ollama). I don't know it that may help.
PragnyaKhandelwal commentedon Dec 1, 2026
Thanks @larsoner, @cbrnr and @brovelli, this is really helpful.
A correction first. While re-running the benchmark I found a mistake on my side: the first results were scored against a development install of MNE (
main, 1.14.dev) instead of 1.13. Its version string still said1.13.0.dev, so I didn't notice.mainhas already removedstandard_1020/standard_1005, but in released 1.13.x they still work with a FutureWarning. So the "montage rename caused 7 of 23 failures" finding was wrong, and I've withdrawn it. Sorry for the noise.I re-scored with
mne==1.13.2(onmainthe original automatic results reproduce exactly, so the version was the cause) and applied your point 2 to the one hand-graded montage question. Strict totals are now Gemini 19, Claude 20, ChatGPT 15 of 24. The repo now pins the version and warns on development installs. Details: RESULTS.md.doc_findings.mdis in the repo; I should have linked it: https://github.com/PragnyaKhandelwal/mne-assistant-benchmark/blob/main/doc_findings.md@cbrnr, agreed. The corrected numbers point the same way: most questions pass, but every assistant still made at least one confident wrong claim about MNE (for example, an argument that doesn't exist).
On your points
extract_label_time_course: say when not to usemean_flip. None of the three assistants got this right (forum 11491), and the defaultmode="auto"usesmean_flipfor magnitude estimates such as free-orientation dSPM.biosemi64are idealized spheres and won't line up with fsaverage. This was the cause in forum 11887, and two of the assistants recommended such montages.adjacency=Nonein the cluster tests: one sentence saying it is rarely right for sensor or source data.Plan for the next months (@brovelli, as promised)
My laptop is CPU-only, so running larger open models (around 20–30B) is where help would make the biggest difference, along with harder questions from people who work in those areas.
neuromechanist commentedon Dec 1, 2026
Great initiative.
OSA models get regular updates. Currently, we offer both Haiku 5.5 (default) and Sonnet 5.5 free of charge to all communities.
OSA also has a CLI, so you can install and run it programmatically; you need to BYOK for the CLI mode though.
Others, like NWB also made such benchmarks (see OpenScience-Collective/osa#514), but mainly to choose which model they want to choose for their assistant.
OSA's promise is transparency. If there is something not shown correctly, prompts, docs access, model, or even effort can be adjusted.
I made a minimal effort (with help of an AI agent) to onboard MNE, with daily/weekly lookups from Discourse, PRs and papers. Feel free to improve.
PragnyaKhandelwal commentedon Dec 2, 2026
Thanks @neuromechanist, that's very helpful. I see MNE is already set up as a community in OSA (
mne, Haiku by default, around 30 doc pages plus Discourse), so I'll test it as it is.My plan:
-a mne, using my own key, three runs each, and score them with the same checks as the web assistants.OSA uses Claude models, so comparing it with plain Claude should show how much the doc access helps by itself. The NWB comparison in OpenScience-Collective/osa#514 is a useful reference for the setup.
A quick update: the first doc PR (
mean_flip, #14621) is merged, thanks @larsoner. The other two (cluster-test adjacency and the template-MRI montage note) are #14628 and #14629