RReyesp commited on
Commit
d7029ef
·
1 Parent(s): 49e3b6e

chore: remove redundant documentation files

Browse files
docs/IMPLEMENTACION_SAVE_ANALYSIS.md DELETED
@@ -1,27 +0,0 @@
1
- # Implementation Notes – `save_analysis` Tool
2
-
3
- This memo documents the addition of the `save_analysis` MCP tool, which allows Claude (or any MCP client) to persist custom sentiment reviews under a specific `customer_id`.
4
-
5
- ## Key Changes
6
-
7
- - Updated `src/mcp_server.py` to register the `save_analysis` tool and validate payloads before writing to SQLite.
8
- - Added unit coverage in `tests/test_save_analysis.py` to confirm inserts, risk updates, and database integrity.
9
- - Expanded documentation in `docs/README.md` and `docs/HOW_TO_SAVE_ANALYSIS.md` with examples and verification steps.
10
-
11
- ## Supporting Assets
12
-
13
- - `docs/HOW_TO_SAVE_ANALYSIS.md` – step-by-step operator guide and FAQ.
14
- - `tests/test_save_analysis.py` – regression suite executed during CI/local validation.
15
- - `tools/view_customer_profile.py` – CLI helper to verify saved analyses.
16
-
17
- ## Usage Checklist
18
-
19
- 1. Run `python tools/view_customer_profile.py <CUSTOMER_ID>` after the tool executes to confirm persistence.
20
- 2. Regenerate portfolio metrics with `python tools/view_database.py` if you need to showcase updated KPIs.
21
- 3. Include the `save_analysis` tool in demo scripts so reviewers can see the end-to-end workflow.
22
-
23
- ## Status
24
-
25
- - All seven MCP tools (analysis, risk, reporting, and persistence) are available.
26
- - Demo dataset includes customers with stored `save_analysis` entries for immediate validation.
27
- - Documentation and tests are aligned with the released functionality.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/README.md DELETED
@@ -1,109 +0,0 @@
1
- # Sentiment Evolution Tracker – MCP Server Guide
2
-
3
- This reference explains how to set up, operate, and extend the Sentiment Evolution Tracker. The system integrates with Claude Desktop via the Model Context Protocol (MCP) and provides persistent sentiment analytics, churn prediction, and portfolio reporting.
4
-
5
- ## Sections
6
-
7
- - Overview
8
- - Feature Highlights
9
- - Installation
10
- - Operating Checklist
11
- - MCP Tool Contracts
12
- - Data Model
13
- - Troubleshooting
14
- - Roadmap & Licensing
15
-
16
- ---
17
-
18
- ## Overview
19
-
20
- Claude excels at single-session analysis but forgets historical context. Sentiment Evolution Tracker solves this gap with an MCP server that:
21
-
22
- - Stores customer interactions and analyses in SQLite.
23
- - Detects sentiment trends (rising, declining, stable).
24
- - Calculates churn probability and surfaces alerts above configurable thresholds.
25
- - Provides dashboards and MCP tools for portfolio-level insights.
26
-
27
- ## Feature Highlights
28
-
29
- - Lightweight NLP pipeline (TextBlob + NLTK) for real-time scoring.
30
- - Risk signal detection (pricing pressure, competitor mentions, frustration).
31
- - Next-best-action recommendation (CHURN / ESCALATION / RESOLUTION / MONITOR_CLOSELY).
32
- - Seven MCP tools covering analytics and data retrieval.
33
- - Deterministic demo dataset for rehearsed demos or recordings.
34
- - CLI utilities: ASCII dashboard, HTML report generator, database viewers.
35
-
36
- ## Installation
37
-
38
- ```powershell
39
- cd mcp-nlp-server
40
- pip install -r requirements.txt
41
- python -m textblob.download_corpora
42
- python -m nltk.downloader punkt averaged_perceptron_tagger
43
- ```
44
-
45
- Register the MCP server in `%APPDATA%\Claude\claude_desktop_config.json`:
46
-
47
- ```json
48
- {
49
- "mcpServers": {
50
- "sentiment-tracker": {
51
- "command": "python",
52
- "args": ["src/mcp_server.py"],
53
- "cwd": "C:/Users/Ruben Reyes/Desktop/MCP_1stHF/mcp-nlp-server"
54
- }
55
- }
56
- }
57
- ```
58
-
59
- Restart Claude Desktop after saving the configuration.
60
-
61
- ## Operating Checklist
62
-
63
- ```powershell
64
- python init_db.py # reset database (optional)
65
- python tools\populate_demo_data.py # load deterministic sample data
66
- python tools\dashboard.py # check ASCII KPIs (Ctrl+C to exit)
67
- python tools\generate_report.py # build data/reporte_clientes.html
68
- python src\mcp_server.py # start MCP server for Claude
69
- ```
70
-
71
- Once the server is running, Claude Desktop surfaces the tools automatically.
72
-
73
- ## MCP Tool Contracts
74
-
75
- | Tool | Purpose |
76
- | --- | --- |
77
- | `analyze_sentiment_evolution` | Scores each message 0–100 and labels the overall trend. |
78
- | `detect_risk_signals` | Surfaces pricing pressure, competitor mentions, frustration phrases. |
79
- | `predict_next_action` | Suggests the most likely outcome (churn, escalation, resolution, monitor). |
80
- | `get_customer_history` | Returns profile data, interaction history, and open alerts. |
81
- | `get_high_risk_customers` | Lists customers whose churn risk exceeds a threshold. |
82
- | `get_database_statistics` | Provides portfolio KPIs (totals, active alerts, average sentiment). |
83
- | `save_analysis` | Persists user-specified analysis results with metadata for future queries. |
84
-
85
- ## Data Model
86
-
87
- | Table | Description |
88
- | --- | --- |
89
- | `customer_profiles` | Aggregated metrics per customer, including lifetime sentiment and churn risk. |
90
- | `conversations` | Each stored analysis with timestamps, trends, predicted actions, confidence. |
91
- | `risk_alerts` | Alerts generated when risk or thresholds exceed configured limits. |
92
-
93
- ## Troubleshooting
94
-
95
- - **Claude cannot find the MCP server** – Verify the absolute path in `claude_desktop_config.json` and restart Claude Desktop after editing.
96
- - **Import errors or missing modules** – Ensure the virtual environment uses Python 3.10+ and rerun `pip install -r requirements.txt`.
97
- - **No demo data appears** – Execute `python init_db.py` followed by `python tools\populate_demo_data.py`.
98
- - **Sentiment results feel off** – Provide at least three customer utterances and include relevant context or escalation history.
99
-
100
- ## Roadmap & Licensing
101
-
102
- - Transformer-based sentiment and emotion tagging.
103
- - Realtime alert delivery via Slack or email.
104
- - Optional REST API for external integrations.
105
- - Expanded multilingual support and PDF/CSV export routines.
106
-
107
- The project is released under the MIT License (`LICENSE`).
108
-
109
- Maintainer: Rubén Reyes · November 2025 · Version 1.0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docs/README_MCP.md DELETED
@@ -1,161 +0,0 @@
1
- # Sentiment Evolution Tracker
2
-
3
- ## Purpose
4
-
5
- A Claude Desktop extension that tracks customer sentiment over time with persistent memory. Claude gains the ability to remember customer histories across sessions.
6
-
7
- ## The Gap
8
-
9
- Standard Claude usage:
10
- - Brilliant single-turn analysis ✅
11
- - Forgets everything after the chat ❌
12
- - Cannot compare customers across conversations ❌
13
- - Lacks historical reporting ❌
14
-
15
- ## The Solution
16
-
17
- This MCP server exposes six domain-specific tools:
18
-
19
- ### Realtime Analysis Tools
20
- 1. **Sentiment Evolution** – Detects whether sentiment is improving, declining, or stable.
21
- 2. **Risk Signal Detection** – Flags pricing pressure, competitor mentions, frustration markers.
22
- 3. **Next Action Prediction** – Suggests whether to escalate, retain, or close.
23
-
24
- ### Historical Intelligence Tools
25
- 4. **Customer History** – Retrieves stored analyses for a customer.
26
- 5. **High-Risk Customers** – Lists accounts trending toward churn.
27
- 6. **Portfolio Statistics** – Summarizes overall health metrics.
28
-
29
- ## High-Level Flow
30
-
31
- ```
32
- User describes customer interaction
33
-
34
- Claude selects the appropriate tool
35
-
36
- MCP server runs analysis or database query
37
-
38
- Results persist to SQLite
39
-
40
- Claude returns structured insights
41
- ```
42
-
43
- ## Practical Example
44
-
45
- **Prompt:**
46
- ```
47
- Customer messages:
48
- - "Service is excellent"
49
- - "Pricing is higher than the competition"
50
- - "Considering a switch"
51
-
52
- Are they at risk?
53
- ```
54
-
55
- **Automatic pipeline:**
56
- 1. Sentiment shifts from 57 → 43/100 (trend `DECLINING`).
57
- 2. Signals highlight competitor mention and potential churn.
58
- 3. Recommended action: `MONITOR_CLOSELY` with 65% confidence.
59
- 4. Analysis is stored in the database.
60
- 5. If risk > 70%, an alert is created.
61
-
62
- **Claude responds:**
63
- ```
64
- Medium risk detected:
65
- - Declining sentiment trajectory
66
- - Explicit competitor comparison
67
- - Action: urgent outreach and pricing review
68
- ```
69
-
70
- ## Why It Matters
71
-
72
- **Without MCP**
73
- - Claude only reflects the current conversation.
74
- - Historical context is lost.
75
- - No portfolio-level reporting.
76
-
77
- **With MCP**
78
- - Persistent memory across customers ✅
79
- - Trend comparisons over time ✅
80
- - Automated alert generation ✅
81
- - Portfolio dashboards ✅
82
-
83
- ## Real-World Scenario
84
-
85
- **Day 1 – New customer "Juan García"**
86
- ```
87
- Sentiment: STABLE at 70/100
88
- Risk: Low
89
- Record stored in SQLite
90
- ```
91
-
92
- **Day 7 – Follow-up from Juan García**
93
- ```
94
- Message: "Pricing is too high; I might switch"
95
- Sentiment drops to 43/100 → trend DECLINING
96
- Risk moves to MEDIUM
97
- Alert generated automatically
98
- ```
99
-
100
- **Outcome:**
101
- - Detects customer sentiment shifts immediately.
102
- - Maintains full conversation history.
103
- - Surfaces alerts before churn occurs.
104
- - Enables data-driven retention strategies.
105
-
106
- ## Technology Stack
107
-
108
- - **Python 3.10** for orchestration.
109
- - **Anthropic MCP** for Claude integration.
110
- - **SQLite** for persistent storage.
111
- - **TextBlob + NLTK** delivering lightweight NLP.
112
-
113
- ## Feature Highlights
114
-
115
- ✅ Automated sentiment scoring
116
- ✅ Risk signal detection
117
- ✅ Churn prediction with recommended actions
118
- ✅ Persistent customer histories
119
- ✅ Alert generation when thresholds are crossed
120
- ✅ Portfolio-level reporting
121
-
122
- ## Quick Installation
123
-
124
- 1. `pip install -r requirements.txt`
125
- 2. `python -m nltk.downloader punkt`
126
- 3. Register the server in Claude Desktop config.
127
- 4. Restart Claude to apply.
128
-
129
- ## Current Limitations
130
-
131
- - Lexical sentiment model (no deep transformer yet).
132
- - Optimized for English and Spanish.
133
- - Probabilistic scoring; not deterministic.
134
- - Works best with conversations ≥ 3 messages.
135
-
136
- ## Roadmap
137
-
138
- - Transformer-based sentiment and emotion detection.
139
- - Web dashboard for live monitoring.
140
- - Realtime notifications (Slack/email/webhook).
141
- - Expanded multilingual support.
142
- - Fine-grained emotion tagging.
143
-
144
- ## Value Proposition
145
-
146
- 1. **Data persistence** – Claude remembers customers across sessions.
147
- 2. **Historical analytics** – Track trends instead of snapshots.
148
- 3. **Automation** – Alerts and predictions run autonomously.
149
- 4. **Scalability** – Moves from single-use analysis to enterprise tooling.
150
-
151
- ## Closing Thoughts
152
-
153
- Sentiment Evolution Tracker is a production-ready MCP server proving how custom tools can elevate Claude from conversational analysis to strategic customer intelligence.
154
-
155
- ---
156
-
157
- **Ready to try it?** The repository ships with demo data and scripts.
158
-
159
- ---
160
-
161
- Rubén Reyes · November 2025 · v1.0