Data Analysis
Patterns for AI-powered analysis: themes, quotes, summaries, and story suggestions.
When to Use
- Adding quotes to story cards
- Implementing story suggestions/related content
- Building theme-based filtering or search
- Creating analytics dashboards
- Integrating AI analysis results
Quick Reference
Analysis Pipeline
Transcript → AI Analysis → themes[], key_quotes[], ai_summary
Story → Connections → Related Stories, Suggested Content
Key Tables
| Table |
Analysis Fields |
transcripts |
themes, key_quotes, ai_summary, ai_processing_status |
stories |
themes, cultural_tags, featured_quote |
storytellers |
expertise_themes, connection_strength |
Theme Categories
- cultural: identity, heritage, tradition, language, ceremony
- family: kinship, elders, children, ancestors, community
- land: country, connection, seasons, wildlife, sacred-sites
- resilience: survival, adaptation, strength, healing, hope
- knowledge: wisdom, teaching, learning, stories, dreams
Common Queries
-- Stories with matching theme
SELECT * FROM stories WHERE themes && ARRAY['identity', 'heritage'];
-- Theme frequency
SELECT unnest(themes) as theme, count(*) FROM stories GROUP BY theme ORDER BY count DESC;
API Endpoints
| Endpoint |
Purpose |
POST /api/transcripts/{id}/analyze |
Trigger AI analysis |
GET /api/stories/{id}/suggestions |
Get related stories |
GET /api/themes |
List themes with counts |
Reference Files
| Topic |
File |
| Code patterns |
refs/analysis-patterns.md |
| SQL queries |
refs/supabase-queries.md |
| Theme hierarchy |
refs/theme-taxonomy.md |
| Sync status |
refs/sync-status.md |
Related Skills
database-navigator - Database exploration
supabase-connection - Database clients
design-component - UI patterns for analysis display
1---2name: data-analysis3description: AI-powered data analysis for Empathy Ledger - themes, quotes, story suggestions, transcript analysis.4---5
6# Data Analysis
7
8Patterns for AI-powered analysis: themes, quotes, summaries, and story suggestions.
9
10## When to Use
11- Adding quotes to story cards
12- Implementing story suggestions/related content
13- Building theme-based filtering or search
14- Creating analytics dashboards
15- Integrating AI analysis results
16
17## Quick Reference
18
19### Analysis Pipeline
20```
21Transcript → AI Analysis → themes[], key_quotes[], ai_summary
22Story → Connections → Related Stories, Suggested Content
23```
24
25### Key Tables
26| Table | Analysis Fields |
27|-------|-----------------|
28| `transcripts` | `themes`, `key_quotes`, `ai_summary`, `ai_processing_status` |
29| `stories` | `themes`, `cultural_tags`, `featured_quote` |
30| `storytellers` | `expertise_themes`, `connection_strength` |
31
32### Theme Categories
33- **cultural**: identity, heritage, tradition, language, ceremony
34- **family**: kinship, elders, children, ancestors, community
35- **land**: country, connection, seasons, wildlife, sacred-sites
36- **resilience**: survival, adaptation, strength, healing, hope
37- **knowledge**: wisdom, teaching, learning, stories, dreams
38
39### Common Queries
40```sql
41-- Stories with matching theme
42SELECT * FROM stories WHERE themes && ARRAY['identity', 'heritage'];
43
44-- Theme frequency
45SELECT unnest(themes) as theme, count(*) FROM stories GROUP BY theme ORDER BY count DESC;
46```
47
48### API Endpoints
49| Endpoint | Purpose |
50|----------|---------|
51| `POST /api/transcripts/{id}/analyze` | Trigger AI analysis |
52| `GET /api/stories/{id}/suggestions` | Get related stories |
53| `GET /api/themes` | List themes with counts |
54
55## Reference Files
56| Topic | File |
57|-------|------|
58| Code patterns | `refs/analysis-patterns.md` |
59| SQL queries | `refs/supabase-queries.md` |
60| Theme hierarchy | `refs/theme-taxonomy.md` |
61| Sync status | `refs/sync-status.md` |
62
63## Related Skills
64- `database-navigator` - Database exploration
65- `supabase-connection` - Database clients
66- `design-component` - UI patterns for analysis display