Skip to content

MOTTIVME UNIFIED AI SYSTEM - Arquitetura Completa ​

Visao Geral do Projeto ​

Sistema unificado de IA para vendas B2B que integra:

  • Atendimento automatizado via WhatsApp, Instagram, LinkedIn e Telefone
  • Prospecao ativa com agentes autonomos
  • Voice cloning e Avatar AI para abordagens personalizadas
  • RAG/Memoria para aprendizado continuo
  • Self-improvement com loops de reflexao e melhoria automatica

1. INVENTARIO ATUAL ​

1.1 AI Factory V3 - 14 Workflows n8n ​

#WorkflowTriggerFuncao
01Organizador-CallsGoogle Drive /7.Calls/Classifica arquivos por prefixo, move para subpastas
02AI-Agent-Head-VendasGoogle Drive /1.Vendas/Analise BANT/SPIN de calls de diagnostico
02-V2AI-Agent-Head-Vendas-V2Google Drive /1.Vendas/Versao melhorada com mais metricas
03Call-Analyzer-OnboardingGoogle Drive /2.Onboard/Cria agente a partir de call de kickoff
04Agent-FactoryWebhookFabrica de agentes (criacao automatizada)
05AI-Agent-ConversacionalWebhook GHLAgente conversacional base
05-MAI-Agent-Execution-ModularWebhook GHLExecucao modular com 7 modos
06Call-Analyzer-RevisaoGoogle Drive /3.Revisao/Analisa calls de revisao, atualiza agente
07Engenheiro-de-PromptWebhookAjustes manuais em prompts
08Boot-ValidatorSchedule 5minValida agentes (7-10 cenarios simulados)
09QA-AnalystSchedule 1hMonitora qualidade das conversas
10AI-Factory-V3-UnifiedGoogle DrivePipeline unificado completo
10-AAAI-Factory-V3-Unified-ANTI-ALUCINACAOGoogle DriveVersao com protecao anti-alucinacao
11Reflection-LoopWebhookLoop de auto-reflexao e melhoria
12AI-as-JudgeWebhookIA como juiz para avaliar outputs
12-PIPrompt-ImproverWebhookMelhoria automatica de prompts
13Prompt-UpdaterWebhookAtualizacao de prompts no Supabase
14Multi-Tenant-Inbox-ClassifierWebhook GHLClassificador de inbox multi-tenant

Arquitetura em Camadas AI Factory ​

CAMADA 1: INGESTAO
├── 01-Organizador-Calls (Google Drive trigger)
└── 14-Multi-Tenant-Inbox-Classifier (GHL webhook)

CAMADA 2: ANALISE DE CALLS
├── 02-AI-Agent-Head-Vendas (BANT/SPIN)
├── 02-V2-AI-Agent-Head-Vendas (metricas expandidas)
├── 03-Call-Analyzer-Onboarding (cria agente)
└── 06-Call-Analyzer-Revisao (atualiza agente)

CAMADA 3: FABRICA DE AGENTES
├── 04-Agent-Factory (criacao automatizada)
├── 07-Engenheiro-de-Prompt (ajustes manuais)
├── 12-Prompt-Improver (melhoria automatica)
└── 13-Prompt-Updater (atualizacao)

CAMADA 4: VALIDACAO
├── 08-Boot-Validator (testa cenarios)
├── 11-Reflection-Loop (auto-reflexao)
└── 12-AI-as-Judge (avaliacao)

CAMADA 5: EXECUCAO
├── 05-AI-Agent-Conversacional (base)
├── 05-AI-Agent-Execution-Modular (7 modos)
└── 10-AI-Factory-V3-Unified (pipeline completo)

CAMADA 6: QA
└── 09-QA-Analyst (monitora qualidade)

7 Modos do Agent Execution Modular ​

ModoDescricao
first_contactPrimeiro contato com lead
schedulerAgendamento de reuniao
reschedulerReagendamento
conciergeAtendimento geral
customer_successPos-venda
objection_handlerTratamento de objecoes
followuperFollow-up automatico

1.2 AgenticOSKevsAcademy - 23 Agentes Python ​

SquadAgentesFuncao
OUTBOUND (5)LeadDiscovery, ProfileAnalyzer, LeadQualifier, MessageComposer, OutreachExecutorProspeccao ativa Instagram
INBOUND (3)InboxMonitor, LeadClassifier, AutoResponderResponder DMs automaticamente
INFRASTRUCTURE (3)AccountManager, Analytics, ErrorHandlerSuporte e monitoramento
SECURITY (4)RateLimitGuard, SessionSecurity, AntiDetection, ComplianceProtecao anti-ban
PERFORMANCE (4)CacheManager, BatchProcessor, QueueManager, LoadBalancerOtimizacao
QUALITY (4)DataValidator, MessageQuality, Deduplication, AuditLoggerQA

Stack: Python + Playwright + Gemini Vision + Supabase + Redis + FastAPI


1.3 socialfy-platform - Frontend CRM ​

Tabela SupabaseDescricao
socialfy_leadsLeads multicanal (LI, IG, WA, Email)
socialfy_campaignsCampanhas multi-channel
socialfy_cadencesSequencias de follow-up
socialfy_messagesInbox unificado
socialfy_activitiesLog de touchpoints
socialfy_pipeline_dealsPipeline de vendas

Stack: React 19 + Vite + Tailwind + Supabase + Vercel


1.4 Infraestrutura Existente ​

ComponenteFuncaoStatus
GHL (GoHighLevel)CRM, Calendar, Email, Pipeline✅ Producao
Evolution APIWhatsApp integration✅ Producao
SupabasePostgreSQL + Edge Functions✅ Producao
Groq (Llama 3.3 70B)LLM principal✅ Producao
Anthropic (Claude)Validacao e QA✅ Producao
Google DriveStorage de calls✅ Producao

2. GAPS IDENTIFICADOS ​

2.1 Gaps Tecnicos ​

#GapProblemaSolucaoFonte
1Canal de VOZAI Factory so atende texto (WhatsApp)call-center-ai + LLM-VoIP-CallerFork GitHub
2RAG/MemoriaCada analise eh "zerada", nao aprendeLlamaIndex sobre call_recordingsFork GitHub
3Whisper LocalTranscricao depende de API externa ($)faster-whisper self-hostedEcossistema llm.c
4Voice CloningNao tem audio personalizadoChatterbox (MIT license)Open source
5Avatar VideoNao tem video personalizadoDuix.Avatar (open source)Open source
6LinkedIn OutboundNao tem prospeccao LinkedInLinkedIn-Lead-GeneratorFork GitHub

2.2 Repositorios GitHub Disponiveis (Forks) ​

RepoCategoriaPara que serve
llama_indexRAGIndexacao e busca sobre historico
call-center-aiVoIPAtendimento por voz
LLM-VoIP-CallerVoIPLigacoes outbound automaticas
Scrapegraph-aiScrapingEnriquecimento de leads
LinkedIn-Lead-GeneratorLead GenProspeccao LinkedIn
faster-whisperTranscricaoWhisper local (GPU)
supabase-pyDatabaseCliente Python Supabase

3. ARQUITETURA UNIFICADA PROPOSTA ​

┌─────────────────────────────────────────────────────────────────────────────────────┐
│                         MOTTIVME UNIFIED AI SYSTEM                                   │
│                                                                                      │
│  ┌─────────────────────────────────────────────────────────────────────────────────┐│
│  │                            LAYER 1: FRONTEND                                    ││
│  │  ┌─────────────────────┐         ┌─────────────────────┐                        ││
│  │  │  socialfy-platform  │         │  GHL (CRM Oficial)  │                        ││
│  │  │  Dashboard/Analytics│         │  Calendar/Pipeline  │                        ││
│  │  └──────────┬──────────┘         └──────────┬──────────┘                        ││
│  └─────────────┼────────────────────────────────┼──────────────────────────────────┘│
│                │                                │                                    │
│  ┌─────────────┼────────────────────────────────┼──────────────────────────────────┐│
│  │             ▼           LAYER 2: DATABASE    ▼                                  ││
│  │  ┌──────────────────────────────────────────────────────────────────────────┐   ││
│  │  │                           SUPABASE                                        │   ││
│  │  │                                                                           │   ││
│  │  │  EXISTENTES:                          NOVOS:                              │   ││
│  │  │  ├── agent_versions                   ├── client_voice_models             │   ││
│  │  │  ├── agent_conversations              ├── client_avatars                  │   ││
│  │  │  ├── agent_conversation_messages      ├── rag_index                       │   ││
│  │  │  ├── call_recordings                  ├── generated_media                 │   ││
│  │  │  ├── qa_analyses                      └── voice_call_logs                 │   ││
│  │  │  ├── clients                                                              │   ││
│  │  │  ├── locations                                                            │   ││
│  │  │  └── socialfy_* (leads, campaigns, etc)                                   │   ││
│  │  └──────────────────────────────────────────────────────────────────────────┘   ││
│  └─────────────────────────────────────────────────────────────────────────────────┘│
│                                                                                      │
│  ┌─────────────────────────────────────────────────────────────────────────────────┐│
│  │                      LAYER 3: ORCHESTRATION (n8n)                               ││
│  │                                                                                  ││
│  │  AI FACTORY V3 - 14 WORKFLOWS EXISTENTES                                        ││
│  │  ┌─────────────────────────────────────────────────────────────────────────┐    ││
│  │  │ 01-Organizador │ 02-Head-Vendas │ 03-Onboarding │ 04-Agent-Factory     │    ││
│  │  │ 05-Execution   │ 06-Revisao     │ 07-Eng-Prompt │ 08-Boot-Validator    │    ││
│  │  │ 09-QA-Analyst  │ 10-Unified     │ 11-Reflection │ 12-AI-as-Judge       │    ││
│  │  │ 12-Prompt-Imp  │ 13-Prompt-Upd  │ 14-Inbox-Class│                      │    ││
│  │  └─────────────────────────────────────────────────────────────────────────┘    ││
│  │                                                                                  ││
│  │  NOVOS WORKFLOWS                                                                 ││
│  │  ┌─────────────────────────────────────────────────────────────────────────┐    ││
│  │  │ 15-Voice-Generator    │ Gera audio com voz clonada do cliente          │    ││
│  │  │ 16-Avatar-Generator   │ Gera video com avatar do cliente               │    ││
│  │  │ 17-RAG-Query          │ Busca contexto em historico de calls           │    ││
│  │  │ 18-Whisper-Local      │ Transcricao local de calls                     │    ││
│  │  │ 19-VoIP-Handler       │ Atendimento/outbound por telefone              │    ││
│  │  │ 20-LinkedIn-Orchestr  │ Orquestra prospeccao LinkedIn                  │    ││
│  │  └─────────────────────────────────────────────────────────────────────────┘    ││
│  └─────────────────────────────────────────────────────────────────────────────────┘│
│                                                                                      │
│  ┌─────────────────────────────────────────────────────────────────────────────────┐│
│  │                      LAYER 4: AI ENGINES (Self-Hosted)                          ││
│  │                                                                                  ││
│  │  EXISTENTES:                              NOVOS:                                 ││
│  │  ┌───────────────┐ ┌───────────────┐     ┌───────────────┐ ┌───────────────┐    ││
│  │  │  Groq API     │ │  Claude API   │     │  Chatterbox   │ │ Duix.Avatar   │    ││
│  │  │  Llama 3.3    │ │  Sonnet       │     │  Voice Clone  │ │ Video Avatar  │    ││
│  │  └───────────────┘ └───────────────┘     └───────────────┘ └───────────────┘    ││
│  │                                                                                  ││
│  │                                          ┌───────────────┐ ┌───────────────┐    ││
│  │                                          │  LlamaIndex   │ │faster-whisper │    ││
│  │                                          │  RAG Engine   │ │ Transcricao   │    ││
│  │                                          └───────────────┘ └───────────────┘    ││
│  │                                                                                  ││
│  │                                          ┌───────────────┐                      ││
│  │                                          │ call-center-ai│                      ││
│  │                                          │ VoIP Handler  │                      ││
│  │                                          └───────────────┘                      ││
│  └─────────────────────────────────────────────────────────────────────────────────┘│
│                                                                                      │
│  ┌─────────────────────────────────────────────────────────────────────────────────┐│
│  │                      LAYER 5: OUTBOUND AGENTS (Python)                          ││
│  │                                                                                  ││
│  │  AgenticOSKevsAcademy - 23 AGENTES EXISTENTES                                   ││
│  │  ┌─────────────────────────────────────────────────────────────────────────┐    ││
│  │  │ OUTBOUND (5): LeadDiscovery, ProfileAnalyzer, LeadQualifier,            │    ││
│  │  │               MessageComposer, OutreachExecutor                          │    ││
│  │  │ INBOUND (3):  InboxMonitor, LeadClassifier, AutoResponder               │    ││
│  │  │ INFRA (3):    AccountManager, Analytics, ErrorHandler                   │    ││
│  │  │ SECURITY (4): RateLimitGuard, SessionSecurity, AntiDetection, Compliance│    ││
│  │  │ PERF (4):     CacheManager, BatchProcessor, QueueManager, LoadBalancer  │    ││
│  │  │ QUALITY (4):  DataValidator, MessageQuality, Deduplication, AuditLogger │    ││
│  │  └─────────────────────────────────────────────────────────────────────────┘    ││
│  │                                                                                  ││
│  │  NOVO: LinkedIn Squad                                                            ││
│  │  ┌─────────────────────────────────────────────────────────────────────────┐    ││
│  │  │ LinkedInDiscovery, LinkedInProfiler, LinkedInConnector, LinkedInDM      │    ││
│  │  └─────────────────────────────────────────────────────────────────────────┘    ││
│  └─────────────────────────────────────────────────────────────────────────────────┘│
│                                                                                      │
│  ┌─────────────────────────────────────────────────────────────────────────────────┐│
│  │                        LAYER 6: CHANNELS                                        ││
│  │                                                                                  ││
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐  ││
│  │  │ WhatsApp │ │Instagram │ │ LinkedIn │ │  Email   │ │  VoIP    │ │ Telefone │  ││
│  │  │ Evolution│ │AgenticOS │ │  (NOVO)  │ │   GHL    │ │ (NOVO)   │ │   GHL    │  ││
│  │  │    ✅    │ │    ✅    │ │    ❌    │ │    ✅    │ │    ❌    │ │    ✅    │  ││
│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘  ││
│  └─────────────────────────────────────────────────────────────────────────────────┘│
│                                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────┘

4. NOVAS TABELAS SUPABASE ​

sql
-- Modelos de voz clonada por cliente
CREATE TABLE client_voice_models (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  model_path TEXT NOT NULL,
  sample_audio_url TEXT,
  language VARCHAR(10) DEFAULT 'pt-BR',
  quality_score DECIMAL(3,2),
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

-- Avatares de video por cliente
CREATE TABLE client_avatars (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  avatar_model_path TEXT NOT NULL,
  source_video_url TEXT,
  thumbnail_url TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

-- Index RAG para busca semantica
CREATE TABLE rag_index (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  source_type VARCHAR(50), -- 'call_recording', 'conversation', 'document'
  source_id UUID,
  content TEXT,
  embedding VECTOR(1536),
  metadata JSONB DEFAULT '{}',
  created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Cache de midias geradas (audio/video)
CREATE TABLE generated_media (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  lead_id UUID,
  media_type VARCHAR(20), -- 'audio', 'video'
  script_hash VARCHAR(64),
  media_url TEXT NOT NULL,
  duration_seconds INTEGER,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Log de chamadas VoIP
CREATE TABLE voice_call_logs (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  client_id UUID REFERENCES clients(id),
  lead_id UUID,
  direction VARCHAR(20), -- 'inbound', 'outbound'
  phone_number VARCHAR(50),
  duration_seconds INTEGER,
  transcription TEXT,
  sentiment_score DECIMAL(3,2),
  outcome VARCHAR(50),
  recording_url TEXT,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

5. ROADMAP DE IMPLEMENTACAO ​

FASE 0: Integracao Sistemas Existentes (1-2 semanas) ​

TarefaOrigemDestinoResultado
Conectar AgenticOS ao Supabase AI FactoryPythonSupabaseLeads enriquecidos disponiveis
ProfileAnalyzer → Custom Fields GHLAgenticOSGHLHyperpersonalization com dados reais
Quality Squad → 09-QA-AnalystAgenticOSn8nQA expandido com sentiment

FASE 1: Whisper Local (1 semana) ​

TarefaFerramentaImpacto
Deploy faster-whisperDocker + GPUTranscricao $0, 10x mais rapido
Criar 18-Whisper-Local workflown8nProcessamento local de calls
Integrar com 03-Onboardingn8nCalls processadas localmente

FASE 2: RAG/Memoria (2 semanas) ​

TarefaFerramentaImpacto
Deploy LlamaIndexPython + Supabase pgvectorAprende com historico
Indexar call_recordingsVector embeddingsBusca semantica
Criar 17-RAG-Query workflown8nContexto em todas as analises
Integrar com 02-Head-Vendasn8nCompara com calls similares
Integrar com 08-Boot-Validatorn8nCenarios de teste REAIS

FASE 3: Canal de VOZ (3 semanas) ​

TarefaFerramentaImpacto
Deploy call-center-aiDockerAtendimento por ligacao
Criar 19-VoIP-Handler workflown8nOrquestracao de chamadas
Novo modo voice_agent no 05-Executionn8nMulticanal texto+voz
Integrar LLM-VoIP-CallerPythonFollow-up por ligacao automatica

FASE 4: Voice Clone + Avatar (3 semanas) ​

TarefaFerramentaImpacto
Deploy ChatterboxDocker + GPUAudio com voz do cliente
Deploy Duix.AvatarDocker + GPUVideo avatar personalizado
Criar 15-Voice-Generator workflown8nGeracao de audio automatica
Criar 16-Avatar-Generator workflown8nGeracao de video automatica
Integrar com 05-Execution (first_contact)n8nVideo avatar no primeiro contato
Integrar com 05-Execution (followuper)n8nAudio clone no follow-up

FASE 5: LinkedIn Outbound (2 semanas) ​

TarefaFerramentaImpacto
Adaptar LinkedIn-Lead-GeneratorPythonNovo canal de prospeccao
Criar LinkedIn Squad no AgenticOSPython4 novos agentes
Criar 20-LinkedIn-Orchestrator workflown8nOrquestracao LinkedIn
Integrar com socialfy_leadsSupabaseLeads unificados

6. RESULTADO FINAL ESPERADO ​

Canais Operacionais ​

CanalEntradaAtendimentoOutreachAvatar/Voz
WhatsApp✅✅ AI Agent✅ Follow-up✅ Audio clone
Instagram✅✅ AgenticOS✅ DM auto✅ Audio clone
LinkedIn✅-✅ DM auto❌ (nao suporta)
Telefone/VoIP✅✅ AI Voice✅ Ligacao auto✅ Voz clone
Email✅ GHL✅ GHL✅ GHL❌

Metricas de Impacto Estimadas ​

MetricaAtualCom Sistema Completo
Taxa resposta DM texto2-5%-
Taxa resposta DM + audio clone-25-40%
Taxa resposta DM + video avatar-40-60%
Tempo transcricao call 1h~$3.60 (API)$0 (local)
Contexto historico em analises0%100% (RAG)
Canais ativos3 (WA, IG, Email)5 (+LinkedIn, VoIP)

7. REQUISITOS DE INFRAESTRUTURA ​

Hardware para AI Engines (Self-Hosted) ​

ComponenteMinimoRecomendado
GPURTX 3060 12GBRTX 4080 16GB
RAM32GB64GB
StorageSSD 500GBNVMe 1TB
CPU8 cores16 cores

Alternativa Cloud ​

ProvedorCusto EstimadoUso
RunPod~$0.50/hora GPUChatterbox, Duix
Vast.ai~$0.30/hora GPUfaster-whisper
ModalPay-per-useLlamaIndex

8. STACK TECNOLOGICO COMPLETO ​

Backend/Orquestracao ​

  • n8n - Workflow automation (20 workflows)
  • Python - Agentes autonomos (27+ agentes)
  • FastAPI - APIs internas
  • Redis - Message queue e cache

AI/ML ​

  • Groq (Llama 3.3 70B) - LLM principal
  • Anthropic (Claude) - Validacao e QA
  • Chatterbox - Voice cloning
  • Duix.Avatar - Video avatar
  • LlamaIndex - RAG engine
  • faster-whisper - Transcricao local
  • Gemini Vision - Analise de perfis

Database ​

  • Supabase (PostgreSQL) - Database principal
  • pgvector - Vector embeddings para RAG

Integ racoes ​

  • GHL (GoHighLevel) - CRM, Calendar, Email
  • Evolution API - WhatsApp
  • Playwright - Instagram automation
  • call-center-ai - VoIP

Frontend ​

  • React 19 + Vite - socialfy-platform
  • Tailwind CSS - Styling
  • Vercel - Hosting

9. PROXIMOS PASSOS ​

  1. [ ] Validar arquitetura com stakeholders
  2. [ ] Priorizar FASE 0 (integracao sistemas existentes)
  3. [ ] Setup ambiente de desenvolvimento para novos componentes
  4. [ ] Criar POC de voice cloning com Chatterbox
  5. [ ] Documentar APIs internas

Documento gerado em: 2026-01-02Versao: 1.0Projeto: MOTTIVME UNIFIED AI SYSTEM

AI Factory V3 - Mottivme Sales