Body emotion mapper: structured emotion analysis (AnalysisInput) JSON to body-axis states and prompt tags
Project description
🫀 Body Emotion Sensor
Give your AI agent a persistent emotional system based on the TCM Five Zang and Five Elements model.
Quick Start · Features · How It Works · 简体中文
Why Body Emotion Sensor? 💖
Do you ever feel that AI agents lack a true sense of "self"? They might simulate emotions in text, but they don't have a persistent internal state that carries over between conversations.
Body Emotion Sensor is here to change that:
- Persistent State: Give your AI a long-term emotional and physical constitution (baseline) that evolves naturally.
- TCM Five Zang Model: Built on the traditional Chinese medicine concepts of the Five Elements (Metal, Wood, Water, Fire, Earth) to map complex emotional states.
- Turn-by-Turn Updates: Converts structured emotional analysis into real-time body state updates, affecting how the agent responds.
Quick Start 🚀
📥 Install:
pip install body-emotion-sensor
The visualization panel is included in the default install. After installation, you can use the CLI:
bes help
body-emotion-sensor help
🔄 Recommended Flow:
- Print the constitution initialization prompt:
bes prompt init - Initialize state:
bes init-state --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --init-json /path/to/init.json - Check readiness:
bes check-init --workspace /path/to/workspace --agent-id my-agent --name "My Agent" - Bootstrap a new session:
bes bootstrap --workspace /path/to/workspace --agent-id my-agent --name "My Agent" - Run turn updates:
bes run --workspace /path/to/workspace --agent-id my-agent --name "My Agent" --input /path/to/analysis-input.json
Features 🧩
- State Persistence: Stores long-term body-emotion state per workspace and agent identity.
- Session Bootstrap: Generates
TURN_CHANGE_TAGS,BODY_TAG, andBASELINE_PERSONAbefore a new session starts. - Compact Prompt Payload: Provides a lightweight payload for reply shaping without overwhelming the context window.
- Traceable History: Keeps state/history data for debugging and visualization.
- Visualization Panel: Run
bes panelto view the agent's emotional journey visually.
How It Works ✨
body-emotion-sensor distinguishes between two core concepts:
baseline: The agent's native constitution and long-term personality color.current: The body state after the latest turn, influenced by recent interactions.
It converts one turn of structured emotional analysis JSON into persistent body-axis state updates and a compact prompt payload for the reply layer.
Development 🛠️
For local development:
pip install -e .
bes help
Visualization panel:
bes panel --workspace /path/to/workspace --agent-id my-agent
Repository-only docs remain in the source repo, for example:
docs/五脏情绪映射全表.mddocs/五脏情绪七阶状态表.mdprompts/example-openclaw-agents.mdprompts/example-openclaw-tools.md
License 📄
This project is released under the MIT license in the repository LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file body_emotion_sensor-0.1.1.tar.gz.
File metadata
- Download URL: body_emotion_sensor-0.1.1.tar.gz
- Upload date:
- Size: 65.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a09a368c1a80f0edea4053ac77d6becd2623e9559976a96f49a837c0d144fe29
|
|
| MD5 |
829da2963d39785c4f3d4d71ff006536
|
|
| BLAKE2b-256 |
f6d36c6bbf6ee915ad9823c4ebaa1b91e13c45546e9d768b865d9862d79d9006
|
File details
Details for the file body_emotion_sensor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: body_emotion_sensor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 64.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f71ca1326d92f8f8b64deb3c4938a34a26846395b6e958f3809c35e71772218a
|
|
| MD5 |
415fccf3744203abd416cc11b6999b48
|
|
| BLAKE2b-256 |
019d5d192b1eaaf191b984f67f50f30f2161152e5a997c6dff9755cee0363277
|