Skip to content

Add HED-Assistant with comprehensive documentation support#18

Merged
magland merged 1 commit into
magland:mainfrom
neuromechanist:feature/add-hed-assistant
Nov 13, 2025
Merged

Add HED-Assistant with comprehensive documentation support#18
magland merged 1 commit into
magland:mainfrom
neuromechanist:feature/add-hed-assistant

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Implements a new HED (Hierarchical Event Descriptors) assistant following the established BIDS assistant pattern. Provides technical guidance on HED annotation based on official HED specification and resources documentation.

Features

  • 41 documentation sources across HED specification and resources
    • 4 preloaded core documents (Introduction, Terminology, Basic Annotation, Getting Started)
    • 37 on-demand documents organized by 8 categories
  • Organized documentation categories:
    • Specification (4 docs preloaded, 7 on-demand)
    • Introductory guides (2 docs)
    • Quick start tutorials (3 docs)
    • Core concepts (4 docs)
    • Tool guides (5 docs: Python, MATLAB, JavaScript, Online, GUI)
    • Advanced topics (5 docs: validation, search, remodeling, schema development)
    • Integration guides (3 docs: NWB, EEGLAB, INCF)
    • Reference documentation (5 docs including example datasets)

Implementation

Follows BIDS assistant pattern exactly:

  • hedAssistantSystemPrompt.ts: HED-specific guidance and documentation requirements
  • retrieveHedDocs.tsx: Documentation retrieval from hed-specification and hed-resources repos
  • getTools.ts: Tool registration
  • preferences.tsx: UI preferences with collapsible documentation list
  • integration.test.ts: 11 integration tests (all passing)

Testing

  • ✅ All 11 integration tests pass
  • ✅ TypeScript build successful
  • ✅ File structure validated
  • ✅ Documentation tool structure verified
  • ✅ App registration confirmed

Files Modified

  • src/App.tsx - Added HED assistant registration
  • src/tools/getTools.ts - Added HED tools registration
  • README.md - Updated assistant count and description

Files Added

  • src/assistants/hed-assistant/ (5 new files)

Benefits

  • Provides accessible HED guidance to neuroscience researchers
  • Comprehensive coverage of HED ecosystem (spec, tools, integration)
  • Efficient context management with categorized documentation
  • Follows platform patterns for maintainability

Implements HED (Hierarchical Event Descriptors) assistant following BIDS
assistant pattern. Provides guidance on HED annotation based on official
specification and resources.

Features:
- 41 documentation sources across HED specification and resources
- 4 preloaded core documents (Introduction, Terminology, Basic Annotation)
- 37 on-demand docs organized by category (specification, tools, quickstart,
  core concepts, advanced topics, integration, reference)
- Comprehensive system prompt with HED-specific guidance
- Integration tests covering all components

Files:
- hedAssistantSystemPrompt.ts: System prompt for HED guidance
- retrieveHedDocs.tsx: Documentation retrieval with 41 sources
- getTools.ts: Tool registration
- preferences.tsx: UI preferences and suggested prompts
- integration.test.ts: 11 integration tests (all passing)

Registered in App.tsx and tools/getTools.ts
Updated README to include HED-Assistant as 8th assistant
@magland magland merged commit 39ea3bd into magland:main Nov 13, 2025
@magland

magland commented Nov 13, 2025

Copy link
Copy Markdown
Owner

@neuromechanist This is great!

This is now deployed:
https://hed-assistant.neurosift.app/chat

@yarikoptic

@neuromechanist

Copy link
Copy Markdown
Contributor Author

cc @VisLab

"https://raw.githubusercontent.com/hed-standard/hed-specification/main/docs/source/08_HED_ontology.md",
includeFromStart: false,
category: "specification-details",
},

@yarikoptic yarikoptic Nov 13, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

here is what the script from

gives for the hed-specification

❯ ./doc_pages_index.py https://www.hedtags.org/hed-specification/
Detecting documentation type for https://www.hedtags.org/hed-specification/
✓ Detected: Sphinx documentation
Fetching Sphinx search index from: https://www.hedtags.org/hed-specification/searchindex.js
Found 11 documents
Checking for _sources/ directory...
✗ No _sources/ directory found
  Consider providing --source-repo for source file URLs
{
  "docs_url": "https://www.hedtags.org/hed-specification/",
  "doc_type": "sphinx",
  "has_sources_dir": false,
  "total_pages": 11,
  "pages": [
    {
      "docname": "01_Introduction",
      "title": "1. Introduction to HED",
      "html_url": "https://www.hedtags.org/hed-specification/01_Introduction.html",
      "source_filename": "01_Introduction.rst"
    },
    {
      "docname": "02_Terminology",
      "title": "2. HED terminology",
      "html_url": "https://www.hedtags.org/hed-specification/02_Terminology.html",
      "source_filename": "02_Terminology.rst"
    },
    {
      "docname": "03_HED_formats",
      "title": "3. HED formats",
      "html_url": "https://www.hedtags.org/hed-specification/03_HED_formats.html",
      "source_filename": "03_HED_formats.rst"
    },
    {
      "docname": "04_Basic_annotation",
      "title": "4. Basic annotation",
      "html_url": "https://www.hedtags.org/hed-specification/04_Basic_annotation.html",
      "source_filename": "04_Basic_annotation.rst"
    },
    {
      "docname": "05_Advanced_annotation",
      "title": "5. Advanced annotation",
      "html_url": "https://www.hedtags.org/hed-specification/05_Advanced_annotation.html",
      "source_filename": "05_Advanced_annotation.rst"
    },
    {
      "docname": "06_Infrastructure_and_tools",
      "title": "6. Infrastructure and tools",
      "html_url": "https://www.hedtags.org/hed-specification/06_Infrastructure_and_tools.html",
      "source_filename": "06_Infrastructure_and_tools.rst"
    },
    {
      "docname": "07_Library_schemas",
      "title": "7. Library schemas",
      "html_url": "https://www.hedtags.org/hed-specification/07_Library_schemas.html",
      "source_filename": "07_Library_schemas.rst"
    },
    {
      "docname": "08_HED_ontology",
      "title": "8. The HED ontology",
      "html_url": "https://www.hedtags.org/hed-specification/08_HED_ontology.html",
      "source_filename": "08_HED_ontology.rst"
    },
    {
      "docname": "Appendix_A",
      "title": "A. Schema format details",
      "html_url": "https://www.hedtags.org/hed-specification/Appendix_A.html",
      "source_filename": "Appendix_A.rst"
    },
    {
      "docname": "Appendix_B",
      "title": "B. HED errors",
      "html_url": "https://www.hedtags.org/hed-specification/Appendix_B.html",
      "source_filename": "Appendix_B.rst"
    },
    {
      "docname": "index",
      "title": "HED Specification",
      "html_url": "https://www.hedtags.org/hed-specification/index.html",
      "source_filename": "index.rst"
    }
  ]
}

and below for hed-resources

title: "HED Annotation Quickstart",
url: "https://www.hedtags.org/hed-resources/HedAnnotationQuickstart.html",
sourceUrl:
"https://raw.githubusercontent.com/hed-standard/hed-resources/main/docs/source/HedAnnotationQuickstart.md",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

{
  "docs_url": "https://www.hedtags.org/hed-resources/",
  "doc_type": "sphinx",
  "has_sources_dir": false,
  "total_pages": 28,
  "pages": [
    {
      "docname": "BidsAnnotationQuickstart",
      "title": "BIDS annotation quickstart",
      "html_url": "https://www.hedtags.org/hed-resources/BidsAnnotationQuickstart.html",
      "source_filename": "BidsAnnotationQuickstart.rst"
    },
    {
      "docname": "CTaggerGuiTaggingTool",
      "title": "CTagger GUI tagging tool",
      "html_url": "https://www.hedtags.org/hed-resources/CTaggerGuiTaggingTool.html",
      "source_filename": "CTaggerGuiTaggingTool.rst"
    },
    {
      "docname": "DocumentationSummary",
      "title": "Documentation summary",
      "html_url": "https://www.hedtags.org/hed-resources/DocumentationSummary.html",
      "source_filename": "DocumentationSummary.rst"
    },
    {
      "docname": "HEDSubmissionToINCF",
      "title": "HED INCF Standard Application",
      "html_url": "https://www.hedtags.org/hed-resources/HEDSubmissionToINCF.html",
      "source_filename": "HEDSubmissionToINCF.rst"
    },
    {
      "docname": "HedAndEEGLAB",
      "title": "HED and EEGLAB",
      "html_url": "https://www.hedtags.org/hed-resources/HedAndEEGLAB.html",
      "source_filename": "HedAndEEGLAB.rst"
    },
    {
      "docname": "HedAnnotationInNWB",
      "title": "HED annotation in NWB",
      "html_url": "https://www.hedtags.org/hed-resources/HedAnnotationInNWB.html",
      "source_filename": "HedAnnotationInNWB.rst"
    },
    {
      "docname": "HedAnnotationQuickstart",
      "title": "HED annotation quickstart",
      "html_url": "https://www.hedtags.org/hed-resources/HedAnnotationQuickstart.html",
      "source_filename": "HedAnnotationQuickstart.rst"
    },
    {
      "docname": "HedAnnotationSemantics",
      "title": "HED annotation semantics",
      "html_url": "https://www.hedtags.org/hed-resources/HedAnnotationSemantics.html",
      "source_filename": "HedAnnotationSemantics.rst"
    },
    {
      "docname": "HedConditionsAndDesignMatrices",
      "title": "HED conditions and design matrices",
      "html_url": "https://www.hedtags.org/hed-resources/HedConditionsAndDesignMatrices.html",
      "source_filename": "HedConditionsAndDesignMatrices.rst"
    },
    {
      "docname": "HedGovernance",
      "title": "HED governance",
      "html_url": "https://www.hedtags.org/hed-resources/HedGovernance.html",
      "source_filename": "HedGovernance.rst"
    },
    {
      "docname": "HedHistory",
      "title": "Brief history of HED",
      "html_url": "https://www.hedtags.org/hed-resources/HedHistory.html",
      "source_filename": "HedHistory.rst"
    },
    {
      "docname": "HedJavascriptTools",
      "title": "HED JavaScript tools",
      "html_url": "https://www.hedtags.org/hed-resources/HedJavascriptTools.html",
      "source_filename": "HedJavascriptTools.rst"
    },
    {
      "docname": "HedMatlabTools",
      "title": "HED MATLAB tools",
      "html_url": "https://www.hedtags.org/hed-resources/HedMatlabTools.html",
      "source_filename": "HedMatlabTools.rst"
    },
    {
      "docname": "HedOnlineTools",
      "title": "HED online tools",
      "html_url": "https://www.hedtags.org/hed-resources/HedOnlineTools.html",
      "source_filename": "HedOnlineTools.rst"
    },
    {
      "docname": "HedPythonTools",
      "title": "HED Python tools",
      "html_url": "https://www.hedtags.org/hed-resources/HedPythonTools.html",
      "source_filename": "HedPythonTools.rst"
    },
    {
      "docname": "HedRemodelingQuickstart",
      "title": "HED remodeling quickstart",
      "html_url": "https://www.hedtags.org/hed-resources/HedRemodelingQuickstart.html",
      "source_filename": "HedRemodelingQuickstart.rst"
    },
    {
      "docname": "HedRemodelingTools",
      "title": "HED remodeling tools",
      "html_url": "https://www.hedtags.org/hed-resources/HedRemodelingTools.html",
      "source_filename": "HedRemodelingTools.rst"
    },
    {
      "docname": "HedSchemaDevelopersGuide",
      "title": "HED schema developer\u2019s guide",
      "html_url": "https://www.hedtags.org/hed-resources/HedSchemaDevelopersGuide.html",
      "source_filename": "HedSchemaDevelopersGuide.rst"
    },
    {
      "docname": "HedSchemas",
      "title": "HED schemas",
      "html_url": "https://www.hedtags.org/hed-resources/HedSchemas.html",
      "source_filename": "HedSchemas.rst"
    },
    {
      "docname": "HedSearchGuide",
      "title": "HED search guide",
      "html_url": "https://www.hedtags.org/hed-resources/HedSearchGuide.html",
      "source_filename": "HedSearchGuide.rst"
    },
    {
      "docname": "HedSummaryGuide",
      "title": "HED summary guide",
      "html_url": "https://www.hedtags.org/hed-resources/HedSummaryGuide.html",
      "source_filename": "HedSummaryGuide.rst"
    },
    {
      "docname": "HedTestDatasets",
      "title": "HED test datasets",
      "html_url": "https://www.hedtags.org/hed-resources/HedTestDatasets.html",
      "source_filename": "HedTestDatasets.rst"
    },
    {
      "docname": "HedValidationGuide",
      "title": "HED validation guide",
      "html_url": "https://www.hedtags.org/hed-resources/HedValidationGuide.html",
      "source_filename": "HedValidationGuide.rst"
    },
    {
      "docname": "HowCanYouUseHed",
      "title": "How can you use HED?",
      "html_url": "https://www.hedtags.org/hed-resources/HowCanYouUseHed.html",
      "source_filename": "HowCanYouUseHed.rst"
    },
    {
      "docname": "IntroductionToHed",
      "title": "Introduction to HED",
      "html_url": "https://www.hedtags.org/hed-resources/IntroductionToHed.html",
      "source_filename": "IntroductionToHed.rst"
    },
    {
      "docname": "UnderstandingHedVersions",
      "title": "Understanding HED versions",
      "html_url": "https://www.hedtags.org/hed-resources/UnderstandingHedVersions.html",
      "source_filename": "UnderstandingHedVersions.rst"
    },
    {
      "docname": "WhatsNew",
      "title": "What\u2019s new?",
      "html_url": "https://www.hedtags.org/hed-resources/WhatsNew.html",
      "source_filename": "WhatsNew.rst"
    },
    {
      "docname": "index",
      "title": "HED resources",
      "html_url": "https://www.hedtags.org/hed-resources/index.html",
      "source_filename": "index.rst"
    }
  ]
}

which shows deficiency that sources are not discovered!

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