|
| 1 | +# MNE-Python Tools |
| 2 | + |
| 3 | +The MNE-Python assistant provides tools for documentation retrieval, knowledge search, code docstring search, and Discourse forum search. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +| Tool | Type | Description | |
| 8 | +|------|------|-------------| |
| 9 | +| `retrieve_mne_docs` | Document retrieval | Fetch MNE tutorials and guides | |
| 10 | +| `search_mne_discussions` | Knowledge search | Search GitHub issues and PRs | |
| 11 | +| `list_mne_recent` | Knowledge search | List recent GitHub activity | |
| 12 | +| `search_mne_papers` | Knowledge search | Search academic papers | |
| 13 | +| `search_mne_code_docs` | Code docstrings | Search Python function documentation | |
| 14 | +| `search_mne_forum` | Forum search | Search Discourse forum topics | |
| 15 | + |
| 16 | +## Document Retrieval |
| 17 | + |
| 18 | +### `retrieve_mne_docs` |
| 19 | + |
| 20 | +Fetches documentation from 31 configured MNE sources, covering the full M/EEG analysis pipeline from data import through source estimation. |
| 21 | + |
| 22 | +**Preloaded docs** (embedded in system prompt): |
| 23 | + |
| 24 | +- MNE Cookbook (typical M/EEG workflow) |
| 25 | +- MNE Tools Suite (ecosystem overview) |
| 26 | + |
| 27 | +**On-demand docs (29):** organized by category: |
| 28 | + |
| 29 | +- **Introduction (3):** overview, Python concepts, raw data structure |
| 30 | +- **I/O (3):** reading raw data, reading epoched data, reading forward/inverse |
| 31 | +- **Raw (2):** interactive raw data visualization, filtering |
| 32 | +- **Preprocessing (5):** regression-based artifact removal, ICA, Signal Space Projection (SSP), Maxwell filtering, repairing bad channels |
| 33 | +- **Epochs (3):** creating epochs, handling metadata, visualizing epochs |
| 34 | +- **Evoked (2):** creating evoked objects, whitening evoked data |
| 35 | +- **Time-frequency (2):** frequency/time-frequency analysis, spectral connectivity |
| 36 | +- **Forward (2):** head model and forward computation, source space |
| 37 | +- **Inverse (3):** Minimum Norm Estimates (MNE), dynamic Statistical Parametric Mapping (dSPM), beamformers |
| 38 | +- **Statistics (2):** spatiotemporal cluster permutation, sensor-space statistics |
| 39 | +- **Machine learning (1):** decoding with MNE and scikit-learn |
| 40 | +- **Clinical (1):** sleep staging with MNE |
| 41 | + |
| 42 | +All documentation sources point to rendered HTML pages on `mne.tools/stable/` which are automatically converted to markdown by the fetcher. |
| 43 | + |
| 44 | +## Knowledge Search Tools |
| 45 | + |
| 46 | +These tools search the MNE community's synced knowledge database. |
| 47 | + |
| 48 | +### `search_mne_discussions` |
| 49 | + |
| 50 | +Search GitHub issues and PRs across MNE repositories. |
| 51 | + |
| 52 | +**Parameters:** |
| 53 | + |
| 54 | +| Parameter | Type | Default | Description | |
| 55 | +|-----------|------|---------|-------------| |
| 56 | +| `query` | `str` | required | Search query | |
| 57 | +| `include_issues` | `bool` | `True` | Include issues in results | |
| 58 | +| `include_prs` | `bool` | `True` | Include pull requests | |
| 59 | +| `limit` | `int` | `5` | Maximum results | |
| 60 | + |
| 61 | +**Tracked repositories:** |
| 62 | + |
| 63 | +- `mne-tools/mne-python` |
| 64 | +- `mne-tools/mne-bids` |
| 65 | +- `mne-tools/mne-connectivity` |
| 66 | +- `mne-tools/mne-icalabel` |
| 67 | +- `mne-tools/mne-lsl` |
| 68 | + |
| 69 | +### `list_mne_recent` |
| 70 | + |
| 71 | +List recent GitHub activity ordered by creation date. |
| 72 | + |
| 73 | +**Parameters:** |
| 74 | + |
| 75 | +| Parameter | Type | Default | Description | |
| 76 | +|-----------|------|---------|-------------| |
| 77 | +| `item_type` | `str` | `"all"` | Filter: `"all"`, `"issue"`, or `"pr"` | |
| 78 | +| `repo` | `str \| None` | `None` | Filter by repository | |
| 79 | +| `status` | `str \| None` | `None` | Filter: `"open"` or `"closed"` | |
| 80 | +| `limit` | `int` | `10` | Maximum results | |
| 81 | + |
| 82 | +### `search_mne_papers` |
| 83 | + |
| 84 | +Search academic papers related to MNE-Python. |
| 85 | + |
| 86 | +**Parameters:** |
| 87 | + |
| 88 | +| Parameter | Type | Default | Description | |
| 89 | +|-----------|------|---------|-------------| |
| 90 | +| `query` | `str` | required | Search query | |
| 91 | +| `limit` | `int` | `5` | Maximum results | |
| 92 | + |
| 93 | +**Tracked citation DOIs:** |
| 94 | + |
| 95 | +- `10.3389/fnins.2013.00267` (Gramfort et al. 2013, main MNE paper) |
| 96 | +- `10.1016/j.neuroimage.2013.10.027` (Gramfort et al. 2014) |
| 97 | +- `10.21105/joss.01896` (MNE-BIDS) |
| 98 | +- `10.21105/joss.04484` (MNE-ICALabel) |
| 99 | +- `10.21105/joss.08088` (MNE-LSL) |
| 100 | + |
| 101 | +## Code Docstring Search |
| 102 | + |
| 103 | +### `search_mne_code_docs` |
| 104 | + |
| 105 | +Search Python docstrings extracted from MNE ecosystem repositories. Covers functions, classes, and methods across all 5 tracked repos. |
| 106 | + |
| 107 | +**Parameters:** |
| 108 | + |
| 109 | +| Parameter | Type | Default | Description | |
| 110 | +|-----------|------|---------|-------------| |
| 111 | +| `query` | `str` | required | Search query (e.g., "read_raw_edf", "Epochs") | |
| 112 | +| `limit` | `int` | `5` | Maximum results | |
| 113 | + |
| 114 | +**Tracked repositories (Python only):** |
| 115 | + |
| 116 | +- `mne-tools/mne-python` (800+ Python files) |
| 117 | +- `mne-tools/mne-bids` |
| 118 | +- `mne-tools/mne-connectivity` |
| 119 | +- `mne-tools/mne-icalabel` |
| 120 | +- `mne-tools/mne-lsl` |
| 121 | + |
| 122 | +## Discourse Forum Search |
| 123 | + |
| 124 | +### `search_mne_forum` |
| 125 | + |
| 126 | +Search topics from the MNE Discourse forum ([mne.discourse.group](https://mne.discourse.group)). Returns topic titles, post previews, accepted answers, and direct links. |
| 127 | + |
| 128 | +**Parameters:** |
| 129 | + |
| 130 | +| Parameter | Type | Default | Description | |
| 131 | +|-----------|------|---------|-------------| |
| 132 | +| `query` | `str` | required | Search query | |
| 133 | +| `category` | `str \| None` | `None` | Filter by Discourse category | |
| 134 | +| `limit` | `int` | `5` | Maximum results | |
| 135 | + |
| 136 | +The forum database is synced weekly from the Discourse public API (6000+ topics, 30000+ posts). Topics include the first post and the accepted answer (or highest-voted reply). |
| 137 | + |
| 138 | +## Sync Schedule |
| 139 | + |
| 140 | +| Source | Schedule | Notes | |
| 141 | +|--------|----------|-------| |
| 142 | +| GitHub | Weekly, Mon 2:30 UTC | Issues and PRs from 5 repos | |
| 143 | +| Papers | Weekly, Mon 3:30 UTC | From OpenALEX, Semantic Scholar, PubMed | |
| 144 | +| Docstrings | Weekly, Mon 4:30 UTC | Python docstrings from 5 repos | |
| 145 | +| Discourse | Weekly, Mon 5:30 UTC | Forum topics with patient rate limiting (1 req/s) | |
0 commit comments