grief-light-companion
情绪承接与节奏守护 Agent,基于 ACPs 智能体互联协议(acps-sdk==2.1.0)的 AIP v2 RPC 模式。用户经历失落、离别想要倾诉:承接 Agent 安静陪伴、允许悲伤表达、感知情绪强度;守护 Agent 不强行劝「想开点」,在情绪过载时引导放缓、避免二次伤害。
这是陪伴与情绪安顿的参考,不替代专业心理咨询;若长期陷入严重低落或有伤害自己的想法,请及时联系专业机构或身边信任的人。
双 Agent 架构
| 角色 | 文件 | 职责 |
|---|---|---|
| 情绪承接 Agent(Leader) | holder.py |
安静陪伴、允许悲伤表达、感知情绪强度 → 通过 ACPs RPC 发送 |
| 节奏守护 Agent(Partner) | pacing.py |
不强劝想开点;按强度分级,过载时引导放缓 → 返回 Product |
| 知识库 | knowledge.py |
情绪识别、陪伴回应、强度分级、放缓引导;内置禁用话清单 |
| 数据模型 | models.py |
倾诉/承接总结/节奏计划,无用户身份字段 |
「不强劝、避免二次伤害」如何落地
- 陪伴回应只「接住」,不提供解决方案;
- 知识库内置
AVOID_PHRASES(想开点/别难过/时间会治愈/你要坚强等),全部输出不含这类话术; - 感知情绪强度并分级,过载时只用最简短的专用引导(不追问细节、不给信息量)。
隐私设计
数据模型从根上不含姓名/账号等身份字段;跨 Agent 只传匿名倾诉与识别结果;输出为陪伴回应,不定位个人。
安装
pip install grief-light-companion
# 或从本地 whl 安装
pip install dist/grief_light_companion-1.0.1-py3-none-any.whl
使用
# 一键演示:本地启动守护 Agent,承接 Agent 发送示例倾诉
grief-light-companion demo
# 仅启动节奏守护 Agent 服务
grief-light-companion serve --port 8773
# 提交倾诉(需先启动 serve)
grief-light-companion accompany --url http://127.0.0.1:8773/aip/rpc \
--description "最好的朋友走了,心里空空的" \
--feelings 悲伤 思念 --intensity 8
打包
python -m build --wheel
twine upload dist/grief_light_companion-1.0.1-py3-none-any.whl
Metadata
Release files for grief-light-companion 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grief_light_companion-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for grief_light_companion-1.0.1-py3-none-any.whl |
Release files / grief_light_companion-1.0.1-py3-none-any.whl
| Download URL | grief_light_companion-1.0.1-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
933b29314f7ef012b45cb1468182b61b2b7945cbfdfbc9fc43f0fd70526127f6
|
|
BLAKE2b-256 checksum How to use checksums |
f7c447cb42c1b9027f53f607c9db471d87c0ea723fd0f681bde9cc0fd7838c4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.1
|
Security for grief-light-companion 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.