Project Info
Inspiration
Today’s AI is powerful, but it’s reactive. Even the most advanced agents still require us to actively type prompts. We must tell the system what we want, how we feel, and when we need help. But humans don’t operate through prompts. Our cognitive state changes continuously. Mind+ was inspired by a question: What if AI could understand your brain state in real time and respond before you ask?
What it does
Mind+ monitors your brain activity in real time using an Emotiv EEG headset to understand whether you are truly engaged or mentally drifting. When studying or reading difficult material, we often think we’re focusing. But in reality, our minds start wandering. NeuroFocus can detect: When you are in deep focus When your attention starts to drift When cognitive load becomes too high When the material may be too abstract or overwhelming Instead of waiting for you to realize you’re distracted, the system can: Gently alert you when your focus drops Suggest a break before burnout Offer clarification when cognitive strain increases Activate an AI agent to assist automatically And this isn’t limited to studying. Because it integrates with your computer environment, NeuroFocus works across: Coding Reading research papers Gaming Writing Any digital task Your brain becomes an input device. Instead of manually prompting AI, your mental state becomes the signal.
How we built it
We used an Emotiv EEG headset to collect real-time mental state data and streamed it to a Jetson Nano for processing. The Jetson runs our pipeline inside Docker, and we exposed the service remotely using ngrok so the system can work from anywhere with low setup friction. In parallel, we built a lightweight computer-context layer that actively monitors the window/app the user is currently working in, so the system understands what task the user is doing without needing manual input. Finally, we connected these two signals, brain state + on-screen context, into a Claude-based agent, which can decide when to proactively engage (e.g., when focus drops, when distraction rises, or when the task becomes cognitively demanding) instead of relying on the user to type prompts.
Challenges we ran into
A core challenge was making the agent safe + useful with the exact signals we get from the Emotiv Cortex API. Cortex gives us high-level performance metrics like attention, engagement, excitement, stress, and relaxation (plus EEG power bands/motion), but mapping those labels to “what the user needs right now” is not straightforward. For example, a drop in focus could mean mind-wandering, fatigue, or simply switching tasks; a rise in stress might mean productive struggle or frustration; and high engagement doesn’t always mean the user is learning effectively. This ambiguity made it hard to design reliable triggers and avoid false positives. Privacy was another big issue because our system combines brain-state metrics with computer context (the active window/app). Even if we only track window titles, it can still reveal sensitive behavior, so we had to minimize what data is logged and carefully control what is passed to the agent. Finally, we tested multiple agent setups. We originally tried running the agent locally using Ollama for maximum privacy, but the on-device models weren’t consistently strong enough to give helpful, context-aware support from signals like attention/stress/relaxation in real time. That’s why we moved to a Claude-based agent, so interventions (explanations, reframes, break suggestions, “ask a guiding question”) are actually high-quality instead of generic.
Accomplishments we're proud of
We’re proud that the system worked better than we expected in a real usage setting: we successfully streamed Emotiv Cortex mental-state metrics (like attention, engagement, stress, and relaxation) into our Jetson Nano processing pipeline and used them to trigger meaningful agent behaviors in real time. We also demonstrated a new interaction pattern for AI agents. Instead of constantly typing prompts, the agent can respond based on your cognitive state, plus what you’re doing on your computer. Finally, we built an end-to-end demo where we used brain commands to drive a complete pipeline that can order food, proving this isn’t just a visualization project, it’s a full neuroadaptive agent workflow.
What we learned
We learned that building neuroadaptive systems is less about raw EEG data and more about interpretation and restraint. Even though the Emotiv Cortex API gives clean high-level metrics like attention, engagement, stress, and relaxation, those labels don’t directly translate into user intent. Brain-state signals are probabilistic, personal, and context-dependent, so designing reliable triggers requires calibration and thoughtful thresholds, not blind automation. We also learned that proactive AI must be carefully timed. Just because focus drops doesn’t mean the agent should interrupt immediately. The hardest problem wasn’t signal processing; it was designing interventions that feel supportive instead of intrusive. Finally, we learned that model capability matters. Running everything locally sounds ideal for privacy, but real-time cognitive assistance requires strong reasoning. Choosing the right balance between privacy, performance, and usability is critical when building brain-integrated AI systems.
What's next
Our next step is turning Mind+ from a hackathon prototype into a usable, everyday product. While the Emotiv headset is powerful, it’s too bulky and impractical for daily life. We’re now working on a lightweight, low-channel EEG design that can capture core mental-state signals related to attention and cognitive drift. Even if it’s not as powerful as a full multi-channel system, our goal is to make it “good enough” for real-world use, portable, comfortable, and affordable. We’re also focusing on improving personalization, refining state-detection models, and making the neuroadaptive agent feel natural and seamless. Long term, we want Mind+ to become a practical brain–computer interface layer that integrates directly into everyday workflows, not just a demo, but a real cognitive companion.
Emotiv Cortex API Python Examples
This folder contains the official Emotiv Cortex API Python examples from Emotiv/cortex-example.
Requirements
- Python 2.7+ or Python 3.4+
- Install dependencies:
pip install -r requirements.txt
Getting Started
- Download EMOTIV Launcher from emotiv.com
- Register your Cortex App to get Client ID and Client Secret: https://emotiv.gitbook.io/cortex-api#create-a-cortex-app
- Update
your_app_client_idandyour_app_client_secretin each script
Files
| File | Description |
|---|---|
cortex.py | Core Cortex API wrapper (WebSocket, JSON-RPC, event handling) |
sub_data.py | Subscribe to EEG, motion, performance metrics, band power |
record.py | Record and export data to CSV/EDF |
marker.py | Inject markers during recording |
mental_command_train.py | Train mental command actions (push, pull, etc.) |
facial_expression_train.py | Train facial expression actions |
live_advance.py | Live mental command data + sensitivity control |
query_records.py | Query, download, and export records |
Focus Agent (Main App)
Real activity + time-on-page + EEG → Jetson. When you stay on difficult content too long, triggers agent for help. Feedback in overlay.
python app.py # Real activity + real Emotiv EEG
python app.py --mock # Mock EEG (no headset, for testing)
python app.py --long 45 # 45 sec on page before trigger
python app.py --no-feedback # No overlay window
- Activity: Real app/window/URL via ActivityMonitor (lecture, reading, coding, etc.)
- Time: SessionTracker fires at
warn(5s) andlong(10s) – stuck trigger at 10s - EEG: Real Emotiv headset (default);
--mockfor testing without headset - Mental command: Requires trained profile; set
EMOTIV_PROFILEin .env to match your Emotiv BCI profile name - On long threshold: POSTs to Jetson
/eegwith context + duration + mental_state, shows feedback - Streams: activity (with
duration_seconds), eeg, mental_state over WebSocket
Jetson Collector (WebSocket)
Legacy/standalone collector: stream EEG + activity to Jetson.
python collector.py --url wss://YOUR_NGROK_URL --show-feedback
python collector_mock.py --url wss://YOUR_NGROK_URL --show-feedback
- Sends:
eeg,mental_state,activityover WebSocket - Receives: Agent feedback (
{"type": "feedback", "feedback": "..."}) in overlay - Processor: Jetson runs processor (HTTP + WebSocket)
Data Structures
See DATA_STRUCTURES.md for the exact JSON payloads sent to ngrok: WebSocket (activity, eeg, mental_state, reading_help) and HTTP POST /eeg.
Documentation
Full API docs: https://emotiv.gitbook.io/cortex-api/
Analysis
View
Metric
- 3
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- PythonIn code
- DockerClaimed
1 of 2 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
217 KB
Source files
34
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
bigbrainw/Treehacks26-mac
39 files · 219 KB · @ 21b9842
Structure
Application logic
33 files · 85%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python96%
- Markdown4%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 4- python-dispatch
- python-dotenv
- requests
- websocket-client
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.