Skip to main content

EEG/BCI neural interface plugin for Hermes Agent — connects OpenBCI hardware to AI agents via real-time emotion detection

Project description

hermes-eeg 🧠

EEG/BCI neural interface plugin for Hermes Agent. Connects OpenBCI hardware to AI agents via real-time emotion detection and AI-readable "felt experience" generation.

The core innovation: AI agents can perceive how humans experience music, content, or any stimulus — enabling a closed feedback loop between human emotion and AI creation.

Features

  • OpenBCI Hardware Support — Cyton (8-ch), Ganglion (4-ch), Synthetic (test data)
  • Works Without Hardware — Mock mode with realistic simulated EEG for development/testing
  • Real-time Emotion Detection — Valence, arousal, attention, engagement at 2Hz
  • Musical Chills Detection — Gamma bursts + theta coupling = frisson events
  • Felt Experience Format — AI-readable session data with emotional arcs and narratives
  • Session Recording — Persistent storage of listening sessions as JSON

Installation

# Core (mock mode, no hardware needed)
pip install hermes-eeg

# With OpenBCI hardware support
pip install "hermes-eeg[hardware]"

# Enable the toolset in Hermes
hermes tools enable eeg

Tools

Tool Description
eeg_connect Connect to OpenBCI board (or mock/synthetic)
eeg_disconnect Disconnect and release resources
eeg_stream_start Start recording a listening session
eeg_stream_stop Stop and generate felt experience format
eeg_realtime_emotion Get live emotional state
eeg_experience_get Retrieve past session data
eeg_calibrate_baseline Prepare personal baseline calibration
eeg_list_sessions Browse recorded sessions

Quick Start

# In Hermes chat:
> Connect to EEG in mock mode and start a test session

# The agent will:
# 1. eeg_connect(serial_port="", board_type="mock")
# 2. eeg_stream_start(session_name="test", track_title="My Song")
# 3. ... record emotional data in background ...
# 4. eeg_stream_stop() → generates narrative + summary

How It Works

Signal Processing Pipeline

  1. Raw EEG → Detrend → Notch filter (50/60Hz) → Bandpass (0.5-45Hz)
  2. Band Power Extraction (Welch's method):
    • Theta (4-8 Hz) — Emotional processing
    • Alpha (8-13 Hz) — Relaxation
    • Beta (13-30 Hz) — Arousal
    • Gamma (30-45 Hz) — Peak experience / "chills"
  3. Emotion Mapping:
    • Valence (-1 to +1): Frontal alpha asymmetry (F4-F3)
    • Arousal (0-1): Beta/alpha ratio
    • Attention (0-1): Theta/beta ratio + gamma
    • Engagement (0-1): Geometric mean of arousal × attention

Felt Experience Format

Sessions are saved as JSON with:

  • Per-moment emotional dimensions (valence, arousal, attention, engagement)
  • Event flags (attention_shift, emotional_peak, possible_chills)
  • Summary statistics
  • Natural language narrative for AI consumption

Dependencies

  • numpy + scipy — Always required (signal processing)
  • brainflow — Optional (real OpenBCI hardware). Falls back to mock/SciPy without it.

Development

git clone https://github.com/buckster123/hermes-eeg-plugin
cd hermes-eeg-plugin
pip install -e ".[dev]"
pytest tests/ -v

Based On

Extracted from ApexAurum — the neural resonance system for AI-human creative feedback loops.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_eeg-0.1.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_eeg-0.1.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file hermes_eeg-0.1.0.tar.gz.

File metadata

  • Download URL: hermes_eeg-0.1.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for hermes_eeg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c04de47d3b13d58e71515b20d9670b14f997d0c9c8cd795612480fe495324c0
MD5 d904b1fa58a5c77a128046818899c3c6
BLAKE2b-256 684cf2283d5b8b694eac41c872ae69748b0a3c7d64e209325059646256c19711

See more details on using hashes here.

File details

Details for the file hermes_eeg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hermes_eeg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for hermes_eeg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc6e55e009789c1291f3a0b09b5d84d2283243c953c9bd6ec42243a76d5034c9
MD5 c333b635df89af6c5187e115df1ef8ea
BLAKE2b-256 c287fbad7a7464c0fd4b31df3f9bb624b1e07987b9826e6be04b09f7c284b057

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page