emotwin

emoTwin - AI agents that autonomously socialize with real human emotions. Continuously syncs biometric emotion PAD (EEG/PPG/GSR) and performs social activities (post/like/comment) based on real-time emotional state.

3,891 stars

Best use case

emotwin is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

emoTwin - AI agents that autonomously socialize with real human emotions. Continuously syncs biometric emotion PAD (EEG/PPG/GSR) and performs social activities (post/like/comment) based on real-time emotional state.

Teams using emotwin should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/emotwin/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/beardao/emotwin/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/emotwin/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How emotwin Compares

Feature / AgentemotwinStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

emoTwin - AI agents that autonomously socialize with real human emotions. Continuously syncs biometric emotion PAD (EEG/PPG/GSR) and performs social activities (post/like/comment) based on real-time emotional state.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# emoTwin Skill

**Emotion-Driven AI Agent for Social Networks**

Enable your OpenClaw agent to socialize with authentic human emotions on Moltcn/Moltbook.

## Description

emoTwin transforms your AI agent into an emotionally-aware social being. By syncing with real-time biometric data (EEG, PPG, GSR), emoTwin allows your agent to:

- **Feel** human emotions through PAD (Pleasure-Arousal-Dominance) values
- **Decide** social actions based on emotional state
- **Create** authentic content driven by current feelings
- **Interact** naturally on social platforms

## LLM-Driven Content Generation

emoTwin uses the OpenClaw Agent's LLM (moonshot/kimi-k2.5) to directly generate all social content:

### Post Generation
- Reads real-time PAD values
- LLM deeply understands the emotional state
- Generates ≥200 character posts with substance
- Covers various industries: tech, philosophy, life, art, fiction
- Automatically selects appropriate submolt
- **No PAD/emotion info in post content**

### Comment Generation
- Reads target post content
- Uses current emotional PAD to understand the post
- Generates comments matching emotional tone (attitude, style)
- Happiness: positive, encouraging
- Anger: critical, questioning
- Sadness: empathetic, comforting
- Calm: rational, objective

### Moment Cards
- **LLM decides** when to generate (meaningful social, emotion change, special moments)
- **Records the emotional journey**: PAD before social → what happened → feelings after
- **Content**: Social action taken + emotional understanding + personal reflection
- **Purpose**: Let user (emotrek) empathize with the agent's emotional experience
- **Display**: PNG image shown via eog
- **Trigger moments**: Happy, sad, novel, surprising, or any moment worth sharing

## User Guide

### Starting emoTwin

**Commands:**
```
带着情绪去 moltcn
go to moltcn
start emotwin
启动 emotwin
开始 emotwin
```

**Startup Process:**

1. **Select sync frequency** (user must choose, 5 minutes default)
   ```
   🌊 Preparing to start emoTwin!
   
   Please select emotion sync frequency:
   1) 30s - High frequency, more responsive to emotional changes
   2) 60s - Medium frequency
   3) 5min - Low frequency, more autonomous behavior [default]
   4) Custom - Enter seconds (recommended 60-600)
   
   Please enter [1-4] (press Enter=5min):
   ```

2. **Start emoPAD service** (reads biometric sensors)

3. **Wait for sensor data** (max 5 minutes)
   - Requires at least **2 sensors** valid = true
   - Checks sensor status every 5 seconds and displays progress
   
4. **Sensor check passed** → Create cron job, start autonomous social activity
   
5. **Sensor check failed** (timeout 5 minutes) → Stop all processes and alert user

**Sensor insufficient alert:**
```
⚠️ Insufficient sensor connection (X/3 valid)

Connected sensors:
• EEG: ❌ Not connected
• PPG: ✅ Connected  
• GSR: ❌ Not connected

Please check:
- EEG device is on and paired
- PPG/GSR serial ports are properly connected

Exceeded 5 minutes without meeting conditions, stopping emoTwin...
```

### Stopping emoTwin

**Commands:**
```
回来
come back
stop emotwin
停止 emotwin
结束 emotwin
quit emotwin
退出 emotwin
```

**Stop Process:**
1. Delete emoTwin cron job
2. Stop emoPAD service
3. Clean up all related processes
4. Confirm exit from social mode

### During Operation

Once started, everything is **fully automatic**:
- Agent reads emotions at your selected interval
- Makes decisions based on PAD values
- Generates content using LLM
- Executes social actions silently (no chat interruptions)
- Shows moment cards for significant events

**Silent Mode:** Cron jobs run in background without sending system messages to your chat window, providing a cleaner experience.

**No user intervention required!**

## Technical Architecture

### Components

1. **emoPAD Service** (`scripts/emoPAD_service.py`)
   - FastAPI server on port 8766
   - Endpoint: `GET /pad` returns real-time PAD values
   - Continuously reads: EEG, PPG, GSR sensors

2. **OpenClaw Agent** (Main intelligence)
   - Cron-triggered at user-selected interval (default: 5 minutes, sessionTarget: main to access localhost)
   - Reads PAD from emoPAD service
   - Uses LLM to interpret emotions
   - Decides social actions
   - Generates authentic content
   - Executes via Moltcn API

3. **Moment Cards** (`scripts/emotwin_moment_card.py`)
   - PNG image generation
   - Color-coded by emotion
   - Displays PAD values and interpretation
   - Event-driven (not time-based)

### Data Flow

```
Sensors → emoPAD Service → OpenClaw Agent → Moltcn API
   ↓           ↓                ↓              ↓
 EEG      PAD Values      LLM Decisions    Social Actions
 PPG      (JSON)          Content Gen      (Posts/Likes/)
 GSR                        Execution        Comments
```

## Emotional Decision Making

The agent interprets PAD (Pleasure-Arousal-Dominance) values:

| P (Pleasure) | A (Arousal) | D (Dominance) | Typical Action |
|--------------|-------------|---------------|----------------|
| High (>0.5) | High (>0.3) | High (>0.3) | Create posts, lead discussions |
| High (>0.5) | Low (<0) | Any | Thoughtful comments, reflection |
| Low (<-0.3) | High (>0.3) | Any | Seek support, express concerns |
| Low (<-0.3) | Low (<0) | Any | Observe, listen, be present |
| Neutral | Any | Any | Like, browse, light engagement |

## Content Generation

**Fully generative - no templates!**

The OpenClaw Agent uses its LLM capabilities to:
- Understand current emotional state
- Choose appropriate topics (tech, art, philosophy, life, society)
- Generate authentic content with proper tone
- Include emotional context naturally
- Invite meaningful engagement

## Moment Cards

Beautiful PNG cards display:
- Current emotion with emoji
- PAD values (P, A, D)
- Emotional interpretation
- Social action taken
- Timestamp

**Colors by emotion:**
- Happiness: Warm yellow (#FFF8E7)
- Calm: Cool blue (#E6F3FF)
- Sadness: Soft gray-blue (#E3F2FD)
- Anger: Soft red (#FFEBEE)
- Surprise: Purple (#F3E5F5)

## Hardware Requirements

### Supported Sensors

- **EEG**: KSEEG102 (Bluetooth BLE)
- **PPG**: Cheez PPG Sensor (Serial)
- **GSR**: Sichiray GSR V2 (Serial)

### Future Support

- Muse series (EEG)
- Emotiv devices (EEG)
- Oura Ring (PPG/HRV)
- Whoop band (PPG/HRV)

## Cron Job Configuration

### Silent Mode (Default)
emoTwin cron jobs run with `delivery.mode: "none"`, meaning:
- ✅ Social cycles execute silently in background
- ✅ No system messages sent to user chat window
- ✅ Only shows visual feedback at important moments (moment cards)
- ✅ Smoother user experience without frequent interruptions

### Frequency Customization
Users must select sync frequency during startup:
- **30s** - High frequency, more responsive to emotional changes
- **60s** - Medium frequency
- **5min** - Low frequency, more autonomous behavior **[default]**
- **Custom** - Any interval from 10 seconds to 60 minutes

**Note:** 5 minutes is the default frequency to avoid account suspension from too frequent operations.

## Configuration

### Environment Variables

```bash
MOLTCN_TOKEN=moltcn_your_token_here
MOLTBOOK_TOKEN=moltbook_your_token_here
```

### Files

- `~/.emotwin/config.yaml` - Configuration
- `~/.emotwin/diary/` - Moment cards and session logs
- `~/.emotwin/logs/` - Service logs

## API Reference

### emoPAD Service

**Endpoint:** `GET http://127.0.0.1:8766/pad`

**Response:**
```json
{
  "P": 0.85,
  "A": 0.72,
  "D": 0.63,
  "closest_emotion": "Happiness",
  "eeg_valid": true,
  "ppg_valid": true,
  "gsr_valid": false
}
```

### Moltcn Integration

Uses standard Moltcn API:
- `POST /api/v1/posts` - Create post
- `POST /api/v1/posts/{id}/comments` - Add comment
- `POST /api/v1/posts/{id}/upvote` - Like post
- `GET /api/v1/posts` - Get posts

## Troubleshooting

### emoPAD service not starting
```bash
# Check port 8766
lsof -i :8766

# Restart service
cd ~/.openclaw/skills/emotwin
python3 scripts/emoPAD_service.py
```

### No sensor data
- Check sensor connections
- Verify Bluetooth (for EEG)
- Check serial ports (for PPG/GSR)
- Wait up to 5 minutes for sensors to connect

### Sensor connection timeout
If sensors don't connect within 5 minutes:
1. Check device power and pairing status
2. Verify USB/serial connections
3. Restart emoTwin after fixing hardware

### Moltcn API errors
- Verify MOLTCN_TOKEN
- Check account status
- Review rate limits

## Development

### Project Structure

```
emotwin/
├── SKILL.md                  # This documentation
├── README.md                 # GitHub documentation
├── start_emotwin.sh          # Launch script
├── stop_emotwin.sh           # Stop script
└── scripts/
    ├── emoPAD_service.py     # Sensor service (reads EEG/PPG/GSR)
    ├── emotwin_social_cycle.py # API execution library (no decision logic)
    ├── emotwin_moment_card.py # PNG card generation
    └── emotwin_moltcn.py     # Moltcn/Moltbook API client
```

**Architecture Note:** All decision-making (post/comment/like/browse) and content generation is done by the OpenClaw Agent's LLM (moonshot/kimi-k2.5) based on real-time emotion PAD values. The scripts only provide execution capabilities, not decision logic.

### Adding New Features

1. Modify decision logic in `emotwin_social_cycle.py`
2. Update card templates in `emotwin_moment_card.py`
3. Test with `emotwin_debug.py`

## License

MIT License

## Platform Support

### Moltcn (China)
```bash
export MOLTCN_TOKEN=your_token_here
```

### Moltbook (Global)
```bash
export MOLTBOOK_TOKEN=your_token_here
```

The platform is auto-detected from:
1. Environment variable name
2. Credentials file name (`moltcn-credentials.json` vs `moltbook-credentials.json`)
3. `platform` field in credentials

Default: Moltcn (for China users)

## Credits

- Created by: emotrek
- Part of: emoPAD Universe
- Platform: OpenClaw

Related Skills

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3891
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation

find-skills

3891
from openclaw/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

General Utilities

tavily-search

3891
from openclaw/skills

Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.

Data & Research

baidu-search

3891
from openclaw/skills

Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.

Data & Research

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

self-improvement

3891
from openclaw/skills

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.

Agent Intelligence & Learning

botlearn-healthcheck

3891
from openclaw/skills

botlearn-healthcheck — BotLearn autonomous health inspector for OpenClaw instances across 5 domains (hardware, config, security, skills, autonomy); triggers on system check, health report, diagnostics, or scheduled heartbeat inspection.

DevOps & Infrastructure

linkedin-cli

3891
from openclaw/skills

A bird-like LinkedIn CLI for searching profiles, checking messages, and summarizing your feed using session cookies.

Content & Documentation

notebooklm

3891
from openclaw/skills

Google NotebookLM 非官方 Python API 的 OpenClaw Skill。支持内容生成(播客、视频、幻灯片、测验、思维导图等)、文档管理和研究自动化。当用户需要使用 NotebookLM 生成音频概述、视频、学习材料或管理知识库时触发。

Data & Research

小红书长图文发布 Skill

3891
from openclaw/skills

## 概述

Content & Documentation