# ThreadPulse — Product Design Specification

**Version:** 1.0  
**Status:** Proposal  
**Product:** ThreadPulse — AI Conversation Intelligence for Private Chat History  
**Related product:** [RapportArc](../RapportArc/ReadMe.md) (training and simulation); ThreadPulse focuses on *analysis of real threads* the user supplies.

---

## 1. Executive summary

ThreadPulse is a subscription web application that ingests **private conversation history** (screenshots, pasted text, or—where permitted—direct connection to messaging surfaces) and produces **structured insight**: inferred personality profiles, **dual sentiment/emotion timelines** (you vs. the other participant), **annotated message history** with visual markers for highs and lows, and **green-flag / red-flag** summaries. A **home dashboard** aggregates all imported threads and surfaces a **composite profile** of the user across conversations. Analysis is designed to refresh **incrementally** as new messages are added, so the user sees a live-updating “conversation stock chart” mental model: trajectory, inflection points, and concise text takeaways with **bold keywords** for rapid scanning.

---

## 2. Product vision

| Element | Definition |
|--------|------------|
| **Mission** | Turn messy chat logs into legible patterns: how the tone moves, what resonates, and where friction appears—without replacing judgment or consent. |
| **Differentiation** | Not generic “AI chat”—purpose-built **dyadic thread analytics**, chart vocabulary borrowed from **time-series / market-style** visualization (clear lines, markers, overlays), and **per-thread “her profile”** plus **cross-thread “you profile.”** |
| **Positioning** | Premium consumer or prosumer SaaS; privacy-forward; explicit opt-in for connectors. |

---

## 3. Guiding principles

- **Consent and privacy:** Users import their own data; connectors require clear OAuth scopes; retention and deletion policies documented; no training on user content without opt-in.
- **Inference, not mind-reading:** Copy frames outputs as *inferences* from text; uncertainty can be surfaced in UI for high-stakes interpretations.
- **Respectful framing:** Feedback is behavioral and linguistic, not dehumanizing; avoid stalker-adjacent features (e.g. no “track her without her knowledge” positioning).

---

## 4. Core user journeys

1. **Onboard** → create account → connect or paste first thread.
2. **Ingest** → screenshots (OCR pipeline), raw paste, or API/sync where available → normalized message list with speaker attribution.
3. **Per-thread view** → static **other-party personality profile** card → scrollable **history with markers** → **timeline graph** (metric dropdown) → **green / red flags** → **rapid analysis** strip (short sentences, bold terms).
4. **Home** → list of threads + **composite “you” profile** across threads + aggregate health/sentiment summaries.
5. **Update** → add messages → pipeline re-runs incrementally → charts and flags refresh in near real time.

---

## 5. Major UI surfaces

| Surface | Contents |
|---------|----------|
| **Home dashboard** | Thread list/cards; filters; **composite user personality profile** (traits, communication style aggregates); optional “portfolio” view of emotional trend across threads. |
| **Per-thread page** | **Her profile** (or other party—static panel, one prominent placement); **conversation transcript** with inline/ gutter markers; **timeline** (dual-line chart + event markers); **metric dropdown** (affection, warmth, tension, engagement, humor, etc.—model-dependent); **green flags** (both parties’ positives, momentum, resonance) and **red flags** (misalignment, neglect, tone issues); **concise analysis** block (micro sentences, **bold** keywords). |
| **Ingestion** | Upload screenshots; paste; connector setup; preview before commit. |

---

## 6. System architecture (logical)

```
┌─────────────────────────────────────────────────────────────────┐
│                         Client SPA                               │
│  Dashboard · Thread view · Charts · Markers · Ingestion wizards   │
└────────────────────────────┬────────────────────────────────────┘
                             │ HTTPS
┌────────────────────────────▼────────────────────────────────────┐
│                    API / BFF                                    │
│  Threads · Messages · Jobs · Profiles · Aggregates               │
└─────┬──────────────────┬────────────────────┬──────────────────┘
      │                  │                    │
      ▼                  ▼                    ▼
┌───────────┐    ┌───────────────┐    ┌──────────────────┐
│  Identity │    │  Primary DB   │    │  Object store    │
│           │    │  messages,    │    │  screenshots     │
│           │    │  analyses     │    │                  │
└───────────┘    └───────┬───────┘    └──────────────────┘
                         │
                         ▼
                 ┌───────────────┐
                 │  Queue        │
                 └───────┬───────┘
                         ▼
                 ┌───────────────┐
                 │ LLM + NLP     │
                 │ OCR (images)  │
                 │ Embeddings    │
                 └───────────────┘
```

---

## 7. Key components

| Component | Role |
|-----------|------|
| **Ingestion service** | OCR for screenshots; paste parser; optional OAuth sync; dedupe and ordering. |
| **Speaker diarization** | Map lines to “you” vs. “other” (user-confirmed labels). |
| **Turn-level analysis** | Per-message or per-window sentiment, emotion tags, topics. |
| **Profile inference** | Aggregate to **other-party profile** per thread; **user composite** across threads. |
| **Timeline builder** | Time-indexed series for chart; align **markers** (peaks, dips, incidents). |
| **Flag extractor** | Rule + LLM hybrid for green/red bullet lists with evidence pointers. |
| **Rapid summary** | Template-constrained micro sentences with **bold** entities and metrics. |
| **Realtime / incremental** | Diff new messages; partial recompute; websocket or polling for UI. |

---

## 8. Data model (conceptual)

- **User**, **ConnectedAccount** (optional).
- **Thread** (title, other_party_label, source_type, created_at).
- **Message** (thread_id, seq, speaker, text, timestamp, raw_metadata).
- **AnalysisSnapshot** or versioned **ThreadAnalysis** (profiles JSON, series for charts, flags, summary text).
- **UserAggregateProfile** (rolling composite across threads).

---

## 9. Charting metaphor (“stock-style”)

- Horizontal axis: message index or time.
- Two prominent lines: **your** series vs. **other’s** series for the selected metric.
- **Markers:** green/red (or neutral) dots on the axis or as annotations; optional hover for reason snippet.
- **Dropdown:** switch emotional/sentiment dimensions without leaving the page.

---

## 10. Non-functional requirements

- **Latency:** Incremental analysis P95 target defined per tier; full-thread reanalysis async.
- **Security:** Encrypt at rest; least-privilege tokens; audit log for exports.
- **Accessibility:** Charts have tabular fallbacks; colorblind-safe palettes.

---

## 11. Roadmap (indicative)

| Phase | Scope |
|-------|--------|
| **MVP** | Paste + screenshots; per-thread view; dual timeline; flags; basic profiles. |
| **V1** | Home composite profile; real-time incremental refresh; more metrics. |
| **V2** | Select connectors; team sharing (optional); mobile PWA. |

---

## 12. Relationship to RapportArc

- **RapportArc:** deliberate *practice* and coursework (simulator, drills, curricula).
- **ThreadPulse:** *reflection* on real conversations the user imports—complementary, not duplicate.

---

*Visionary Software Solutions — internal proposal.*
