⚠ 本文为英文原文,暂无中文版。
OpenClaw Sentiment Assistant Work Report
OpenClaw-based social-media sentiment monitoring: conversational operation end-to-end, news collection, Zhipu embedding-2 semantic clustering (Leader algorithm, threshold 0.85), popularity ranking and Feishu push — Python standard library only, zero external dependencies.
Work report for the OpenClaw Public Opinion Assistant — an AI-driven, automated sentiment monitoring and analysis system. Report date: March 17, 2026.
I. System Overview
1.1 Positioning
The OpenClaw Sentiment Assistant enables end-to-end operations — news collection, semantic clustering, trend ranking — through natural-language dialogue.
Core value:
- No programming required; conversational operation;
- Automatic deduplication to avoid duplicated-information interference;
- Popularity ranking for quick identification of trending topics.
1.2 Architecture & Data Flow
Data collection → semantic analysis (Zhipu Embed) → vector-based deduplication & clustering → clustering statistics → SQLite storage → popularity ranking → Feishu group push.
II. Core Technology Selection
2.1 Why the Web-Pilot Search Skill?
| Criteria | Web-Pilot | Traditional crawler |
|---|---|---|
| Anti-scraping | Handled automatically | Manual maintenance |
| Dynamic content | Supports JS rendering | Static pages only |
| Maintenance cost | Low (service-level) | High (code changes per page update) |
| Deployment | Plug-and-play | Environment configuration required |
As a search skill inside the OpenClaw ecosystem, Web-Pilot works out of the box and stays stable under anti-scraping measures.
2.2 Why Zhipu Embedding-2?
- Original plan: local BERT model (sentence-transformers);
- Issue: dependency conflicts inside the container (incompatible PyTorch / safetensors versions);
- Re-evaluation: Zhipu Embedding-2 provides an API of equivalent capability;
- Final choice: the API route — lower operating cost, better stability.
Technical specifications: model embedding-2 (BERT series), vector dimension 1024, cosine similarity.
2.3 Why the Leader Clustering Algorithm?
| Algorithm | Strengths | Weaknesses | Fit |
|---|---|---|---|
| K-Means | Fast | Needs predefined K; iterative convergence | Known cluster count |
| DBSCAN | Arbitrary shapes, handles noise | Parameter-sensitive (eps, minPts) | Spatial clustering |
| Hierarchical | Dendrograms, visualization | O(n³) complexity | Small datasets |
| Leader (used here) | Simple and fast; order-dependent | — | Real-time clustering, news dedup |
Leader algorithm: traverse data sequentially; each unvisited point becomes a “leader”, and points similar to the leader join its cluster.
III. System Features
3.1 Conversational Interface
Users trigger analysis with a natural-language message in a Feishu group:
User: @openclaw Sentiment Assistant, analyze public sentiment. System: automatically performs data collection → clustering → ranking → report generation.
3.2 Output Example
[Today's Top Sentiment Rankings 2026-03-17]
[Ranked by topic popularity (number of related news items)]
No. 1 Crypto trading firm BlockFills files for bankruptcy
Related news: 2 items | Popularity: 100
No. 2 Institutions showed 'diamond hands' during Bitcoin's 50% pullback
Related news: 2 items | Popularity: 100
[Statistics] Original news: 27 | Merged topics: 24 | Top topics: 2
Model: Zhipu embedding-2 | Threshold: 0.85
3.3 Core Computation
For each incoming news item, compute cosine similarity against existing items; similarity ≥ 0.85 joins the same topic; remaining unclassified items are re-processed as new leaders. Topics are ranked by the number of member news items (popularity).
IV. Technical Implementation
4.1 Component Specifications
| Component | Choice |
|---|---|
| AI platform | OpenClaw conversational AI control center |
| Vector model | Zhipu embedding-2 |
| Storage | SQLite |
| Language | Python 3 standard library — zero dependencies, easy to deploy |
4.2 Code Characteristics
- Zero external dependencies: only
urllib,json,sqlite3from the standard library; - In-house vector math: pure-Python dot product, norm and cosine similarity;
- Container-friendly: no
pip install; runs directly.
V. Application Scenarios
- Daily sentiment briefing: scheduled collection, analysis and push;
- Trending event tracking: hottest topics by news count;
- Competitor monitoring: aggregate news by specific keywords.
VI. Next Steps
| Phase | Content | Status |
|---|---|---|
| MVP | Collection + clustering + ranking; Feishu testing & conversational validation | Completed |
| In progress | Scheduled tasks (cron automation) | Configuring |
| Planned | Expand sources to Weibo, Twitter/X, Reddit | In development |
VII. Summary
The OpenClaw Sentiment Assistant achieves zero-threshold sentiment monitoring through three core capabilities: conversational AI, semantic clustering and popularity ranking. Replacing local BERT with Zhipu Embedding-2 significantly reduces deployment and maintenance cost.
System documentation for research purposes; not investment advice.