小红书智能回复助手
by @xiaoliuzhuan
小红书智能回复助手 - 自动分析评论情感和意图,生成个性化回复建议。 Use for: (1) Analyzing Xiaohongshu comment sentiment and intent, (2) Generating personalized reply suggestions, (3) Managi...
clawhub install xiaohongshu-reply-assistant📖 About This Skill
name: xiaohongshu-reply-assistant description: > 小红书智能回复助手 - 自动分析评论情感和意图,生成个性化回复建议。 Use for: (1) Analyzing Xiaohongshu comment sentiment and intent, (2) Generating personalized reply suggestions, (3) Managing comment history and batch processing, (4) Monitoring notes for new comments. Supports both standalone offline analysis and API integration with real Xiaohongshu data. triggers: xiaohongshu reply, rednote comments, 小红书回复, 评论监控, social media management
小红书智能回复助手 / Xiaohongshu Reply Assistant
Intelligent comment analysis and reply suggestion generator for Xiaohongshu (Little Red Book).
Features
Quick Start
Option 1: Quick Analysis (No Setup Required)
from reply_assistant import quick_analyzeresult = quick_analyze(
comment_text="这个地方真好看!想去打卡!",
username="小美",
likes=15
)
print(f"Sentiment: {result['sentiment']}") # 正面
print(f"Intent: {result['intent']}") # 热门评论
print("Suggestions:")
for reply in result['reply_suggestions']:
print(f" - {reply}")
Output:
Sentiment: 正面
Intent: 热门评论
Suggestions:
- @小美 谢谢您的喜欢!😊 欢迎常来互动~
- @小美 感谢您的支持!会继续分享好内容的💪
- @小美 太开心收到您的认可!有什么想看的可以告诉我~
Option 2: Command Line Tool
# Analyze single comment
python3 scripts/xhs_reply_cli.py analyze \
-t "门票多少钱?周末去人多吗?" \
-u 旅行者Batch process from file
python3 scripts/xhs_reply_cli.py batch \
-i comments.txt \
-o report.txtView/edit configuration
python3 scripts/xhs_reply_cli.py config --show
Option 3: Full Integration with Xiaohongshu API
Requires xiaohongshu skill or similar API access.
import asyncio
from xhs_api_integration import XHSApiIntegrationasync def monitor():
integration = XHSApiIntegration(
proxy=None, # or "http://127.0.0.1:7890"
web_session=None # add your session cookie if needed
)
await integration.init_session()
result = await integration.monitor_note(
note_id="your_note_id",
xsec_token="your_xsec_token",
note_title="My Note"
)
report = integration.assistant.generate_report(result, "My Note")
print(report)
await integration.close()
asyncio.run(monitor())
Installation
# Install dependencies
pip3 install aiohttp loguru pycryptodome getuseragentOr use the install script
chmod +x install.sh
./install.sh
Comment Analysis Categories
Sentiment Detection
Intent Recognition
| Intent | Keywords | Example | |--------|----------|---------| | 价格咨询 | 多少钱, 价格, 贵不贵, 费用 | "门票多少钱?" | | 位置咨询 | 哪里, 地址, 位置, 怎么去 | "具体地址在哪里?" | | 提问咨询 | 吗, 怎么, 多少, 请问 | "周末去人多吗?" | | 求资源 | 求, 想要, 链接, 怎么买 | "求购买链接!" | | 热门评论 | Likes >= 10 | High engagement comments | | 其他 | Default | Cannot categorize |Configuration
Config file location: ~/.xhs_reply_assistant/config.json
{
"settings": {
"max_suggestions": 3,
"check_interval_minutes": 30
},
"reply_templates": {
"正面反馈": [
"@{user} 谢谢您的喜欢!😊 欢迎常来互动~",
"@{user} 感谢您的支持!会继续分享好内容的💪"
],
"负面反馈": [
"@{user} 感谢您的反馈,我们会认真改进的!",
"@{user} 抱歉给您带来不好的体验,能否私信详细说说?"
],
"价格咨询": [
"@{user} 关于价格问题,建议您查看置顶评论或私信了解详情哦~",
"@{user} 价格会根据不同情况有所调整,欢迎私信咨询最新优惠!"
]
}
}
Template Variables:
{user}: Commenter's username{answer}: Custom answer text{location}: Location information{transportation}: Transportation instructionsFile Structure
Xiaohongshu Reply Assistant/
├── scripts/
│ ├── reply_assistant.py # Core module (standalone)
│ ├── xhs_reply_cli.py # CLI tool
│ └── xhs_api_integration.py # API integration (optional)
├── examples/
│ ├── example_config.json # Config example
│ └── example_usage.py # Usage examples
├── install.sh # Installation script
└── README.md # Full documentation
Data Storage
All data stored in ~/.xhs_reply_assistant/:
config.json - User configurationhistory.json - Processed comment IDsUse Cases
1. Content Creators: Efficiently manage fan comments and improve engagement quality 2. Brand Operations: Monitor brand-related content and respond to user feedback promptly 3. MCN Agencies: Batch manage comment replies across multiple accounts 4. Data Analysis: Collect user feedback to optimize content strategy
Notes
Requirements
aiohttp, loguru, pycryptodome, getuseragentLicense
MIT License
Author
小流转 (Xiaoliuzhuan)
⚡ When to Use
💡 Examples
Option 1: Quick Analysis (No Setup Required)
from reply_assistant import quick_analyzeresult = quick_analyze(
comment_text="这个地方真好看!想去打卡!",
username="小美",
likes=15
)
print(f"Sentiment: {result['sentiment']}") # 正面
print(f"Intent: {result['intent']}") # 热门评论
print("Suggestions:")
for reply in result['reply_suggestions']:
print(f" - {reply}")
Output:
Sentiment: 正面
Intent: 热门评论
Suggestions:
- @小美 谢谢您的喜欢!😊 欢迎常来互动~
- @小美 感谢您的支持!会继续分享好内容的💪
- @小美 太开心收到您的认可!有什么想看的可以告诉我~
Option 2: Command Line Tool
# Analyze single comment
python3 scripts/xhs_reply_cli.py analyze \
-t "门票多少钱?周末去人多吗?" \
-u 旅行者Batch process from file
python3 scripts/xhs_reply_cli.py batch \
-i comments.txt \
-o report.txtView/edit configuration
python3 scripts/xhs_reply_cli.py config --show
Option 3: Full Integration with Xiaohongshu API
Requires xiaohongshu skill or similar API access.
import asyncio
from xhs_api_integration import XHSApiIntegrationasync def monitor():
integration = XHSApiIntegration(
proxy=None, # or "http://127.0.0.1:7890"
web_session=None # add your session cookie if needed
)
await integration.init_session()
result = await integration.monitor_note(
note_id="your_note_id",
xsec_token="your_xsec_token",
note_title="My Note"
)
report = integration.assistant.generate_report(result, "My Note")
print(report)
await integration.close()
asyncio.run(monitor())
⚙️ Configuration
Config file location: ~/.xhs_reply_assistant/config.json
{
"settings": {
"max_suggestions": 3,
"check_interval_minutes": 30
},
"reply_templates": {
"正面反馈": [
"@{user} 谢谢您的喜欢!😊 欢迎常来互动~",
"@{user} 感谢您的支持!会继续分享好内容的💪"
],
"负面反馈": [
"@{user} 感谢您的反馈,我们会认真改进的!",
"@{user} 抱歉给您带来不好的体验,能否私信详细说说?"
],
"价格咨询": [
"@{user} 关于价格问题,建议您查看置顶评论或私信了解详情哦~",
"@{user} 价格会根据不同情况有所调整,欢迎私信咨询最新优惠!"
]
}
}
Template Variables:
{user}: Commenter's username{answer}: Custom answer text{location}: Location information{transportation}: Transportation instructions