RelatoriosRS β VisΓ£o Geral
CRM de RelatΓ³rios Comerciais da Rocha Sales
Sistema que transforma conversas do Chatwoot em relatΓ³rios comerciais por agente + cliente.
Arquitetura
`
Chatwoot (conversas/mensagens)
β (captura via PostgreSQL)
Hermes Insights DB (Supabase self-hosted)
β
RelatoriosRS (frontend β a construir)
β
Dashboard HTML por agente + cliente
`
Stack
- - Banco: Supabase self-hosted (Docker VPS) β schema
insights - - Chatwoot: PostgreSQL (
root-postgres-1, databasechatwoot_production) - - Sync:
sync_v7.pyβ/root/hermes-insights/sync_v7.py - - Frontend: A construir (RelatoriosRS)
- - sync_v7.py (conversas por agente) β sync_full_clean.py (TODAS conversas)
- - 4.115 conversas no banco local β limpo, sem duplicatas
- - 63.230 mensagens capturadas e linkadas (from sync anterior)
- - Bugs corrigidos: tab delimiter, batch 50 rows, NULL agent handling
- - Bug fix do sync:
04-PROJECTS/HERMES-INSIGHTS-SYNC-BUG-FIX-2026-06-26.md - - Chatwoot DB:
root-postgres-1/chatwoot_production - - Insights DB:
deploy-vps-db-1/postgres/ schemainsights
Estrutura do Vault
`
10-RELATORIOS-RS/
βββ MEMORY/
β βββ INDEX.md β este arquivo
β βββ SCHEMA.md β schema do banco insights
β βββ DADOS.md β mapeamento agentes, inboxes, etc.
βββ DOCS/
β βββ README.md
βββ TOOLS/
βββ SCRIPTS.md
`
Status Atual (2026-06-26)
β Feito
- Sync anterior: sΓ³ 2.829 conversas (filtrado por agente)
- Chatwoot TEM: 4.116 conversas total
- Script correto: /root/hermes-insights/sync_full_clean.py
- Constraint UNIQUE em chatwoot_id adicionada
Distribuicao por Agente
| Agente | Conversas |
| -------- | ----------- |
| (sem agente) | 2.051 |
| Maria Giulha | 1.674 |
| Rayca Soares | 192 |
| Vinicius Sales | 106 |
| Nayara | 84 |
| Victoria | 7 |
| Pietra Maniezzo | 1 |
Scripts no VPS
`
/root/hermes-insights/
βββ sync_full_clean.py β OFICIAL (todas 4.116 conversas) β
βββ sync_v7.py β antigo (soh com agente)
βββ sync_messages_v2.py β mensagens (pendente)
`
π PrΓ³ximos Passos
1. [ ] Sync de mensagens para as 4.115 conversas
2. [ ] Construir frontend RelatoriosRS
3. [ ] Cron job
ReferΓͺncias
Atualizado: 2026-06-26