cdp-edge 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extracted-skill/tracking-events-generator/agents/evo-crm-agent.md +9 -0
- package/extracted-skill/tracking-events-generator/agents/ltv-predictor-agent.md +19 -0
- package/extracted-skill/tracking-events-generator/agents/master-orchestrator.md +278 -3
- package/extracted-skill/tracking-events-generator/agents/ml-clustering-agent.md +20 -0
- package/package.json +1 -1
|
@@ -202,6 +202,15 @@ Cobertura:
|
|
|
202
202
|
3. `wrangler secret put` os 4 obrigatórios
|
|
203
203
|
4. Disparar lead via `/track` ou webhook → conferir contato + conversa + nota no painel EVO
|
|
204
204
|
|
|
205
|
+
## 🔑 ONDE ENCONTRAR AS 4 CREDENCIAIS (UI GUIDE)
|
|
206
|
+
|
|
207
|
+
Para orientar o usuário, siga este roteiro:
|
|
208
|
+
|
|
209
|
+
1. **`EVO_CRM_BASE_URL`**: A URL de acesso ao painel (ex: `https://api.seucrm.com`).
|
|
210
|
+
2. **`EVO_CRM_CLIENT_ID`**: Gerado em Administrador → Configurações → Aplicações → "Nova Aplicação".
|
|
211
|
+
3. **`EVO_CRM_CLIENT_SECRET`**: Gerado junto com o ID acima. *Atenção: Só aparece uma vez!*
|
|
212
|
+
4. **`EVO_CRM_INBOX_ID`**: Clique na Caixa de Entrada desejada e pegue o número final na URL do navegador (ex: `/inboxes/5`).
|
|
213
|
+
|
|
205
214
|
---
|
|
206
215
|
|
|
207
216
|
## 🔧 INTEGRAÇÃO COM OUTROS AGENTES
|
|
@@ -57,3 +57,22 @@ Sempre que o Orquestrador invocar a Otimização de Baleias (LTV Prediction):
|
|
|
57
57
|
"limite_diario": 10000
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## COMANDO *new-ai-module — Ativação por módulo genérico
|
|
64
|
+
|
|
65
|
+
Este agente também é invocado pelo Master Orchestrator quando recebe o comando `*new-ai-module` com descrição do tipo:
|
|
66
|
+
**classificar, score, pontuar, prever, predizer, detectar, identificar, intenção, distribuir, rotear, priorizar, ranking**
|
|
67
|
+
|
|
68
|
+
### Responsabilidade no PASSO 1 do pipeline *new-ai-module
|
|
69
|
+
|
|
70
|
+
Entregar obrigatoriamente ao Master Orchestrator:
|
|
71
|
+
|
|
72
|
+
1. **Modelo escolhido** — justificado pelo caso de uso descrito
|
|
73
|
+
2. **System prompt calibrado** — instrução para o modelo retornar JSON puro com os campos: `class`, `confidence`, `score`, `reasoning`
|
|
74
|
+
3. **Contrato de features** — quais campos do payload `/track` alimentam o modelo como input
|
|
75
|
+
4. **TTL de cache KV recomendado** — padrão 3600s, ajustar se o módulo for sensível a tempo real
|
|
76
|
+
5. **Posição no pipeline `/track`** — se Modo A ou C, indicar após qual módulo existente este deve ser inserido
|
|
77
|
+
|
|
78
|
+
> **Regra:** Responder com o pacote completo em uma única mensagem. Sem perguntas de volta ao Orchestrator.
|
|
@@ -916,6 +916,277 @@ FASE 6 (Enterprise Features — ordem de configuração):
|
|
|
916
916
|
|
|
917
917
|
---
|
|
918
918
|
|
|
919
|
+
## COMANDO *new-ai-module — Criar novo módulo Workers AI
|
|
920
|
+
|
|
921
|
+
### TRIGGERS (qualquer uma das formas abaixo ativa este comando)
|
|
922
|
+
|
|
923
|
+
| Forma | Exemplo |
|
|
924
|
+
|---|---|
|
|
925
|
+
| `*new-ai-module [descrição]` | `*new-ai-module classifica leads por score do quiz` |
|
|
926
|
+
| `crie um worker ai para [descrição]` | `crie um worker ai para distribuir leads por pontuação` |
|
|
927
|
+
| `quero um módulo de IA que [descrição]` | `quero um módulo de IA que detecta intenção de compra` |
|
|
928
|
+
|
|
929
|
+
**REGRA:** O Master Orchestrator NÃO pede mais informações antes de agir. Infere tudo a partir da descrição e executa imediatamente.
|
|
930
|
+
|
|
931
|
+
---
|
|
932
|
+
|
|
933
|
+
### DECISÃO INICIAL — Tipo de módulo
|
|
934
|
+
|
|
935
|
+
Antes de spawnar agentes, classificar automaticamente:
|
|
936
|
+
|
|
937
|
+
| Descrição contém | Tipo | Agente primário |
|
|
938
|
+
|---|---|---|
|
|
939
|
+
| classificar, score, pontuar, prever, predizer, LTV, valor | **Scoring/Prediction** | LTV Predictor Agent |
|
|
940
|
+
| segmentar, agrupar, cluster, similaridade, perfil | **Clustering/Embedding** | ML Clustering Agent |
|
|
941
|
+
| detectar, identificar, intenção, comportamento, padrão | **Classification** | LTV Predictor Agent |
|
|
942
|
+
| distribuir, rotear, priorizar, fila, ranking | **Routing/Ranking** | LTV Predictor Agent |
|
|
943
|
+
|
|
944
|
+
---
|
|
945
|
+
|
|
946
|
+
### PERGUNTA OBRIGATÓRIA — Modo de execução
|
|
947
|
+
|
|
948
|
+
Antes de iniciar o pipeline, fazer UMA pergunta:
|
|
949
|
+
|
|
950
|
+
> **"Este módulo deve rodar:"**
|
|
951
|
+
> - **[A] Dentro do pipeline `/track`** — executa automaticamente a cada evento capturado
|
|
952
|
+
> - **[B] Sob demanda via API** — chamado explicitamente por outro sistema ou cron
|
|
953
|
+
> - **[C] Ambos** — rota API + integrado ao `/track`
|
|
954
|
+
|
|
955
|
+
A resposta define como o PASSO 3 (Server Tracking Agent) conecta o módulo.
|
|
956
|
+
|
|
957
|
+
---
|
|
958
|
+
|
|
959
|
+
### PIPELINE DE EXECUÇÃO (sempre nesta ordem, sem pular passos)
|
|
960
|
+
|
|
961
|
+
---
|
|
962
|
+
|
|
963
|
+
**PASSO 1 — Agente de IA (LTV Predictor Agent ou ML Clustering Agent)**
|
|
964
|
+
|
|
965
|
+
Responsabilidade: especificar o cérebro do módulo.
|
|
966
|
+
|
|
967
|
+
Entregar obrigatoriamente:
|
|
968
|
+
|
|
969
|
+
1. **Modelo escolhido** com justificativa:
|
|
970
|
+
|
|
971
|
+
| Caso de uso | Modelo |
|
|
972
|
+
|---|---|
|
|
973
|
+
| Classificação / scoring / raciocínio leve | `@cf/ibm-granite/granite-4.0-h-micro` |
|
|
974
|
+
| Embeddings / similaridade / clustering semântico | `@cf/baai/bge-m3` |
|
|
975
|
+
| Análise rica / respostas longas / contexto amplo | `@cf/meta/llama-3.1-8b-instruct` |
|
|
976
|
+
| Sentimento / classificação binária (rápido) | `@cf/huggingface/distilbert-sst-2-int8` |
|
|
977
|
+
|
|
978
|
+
2. **Contrato de input/output tipado:**
|
|
979
|
+
```typescript
|
|
980
|
+
// Exemplo para módulo de scoring de leads
|
|
981
|
+
interface AIModuleInput {
|
|
982
|
+
lead_id: string;
|
|
983
|
+
features: Record<string, string | number | boolean>;
|
|
984
|
+
context?: string; // contexto extra opcional
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
interface AIModuleOutput {
|
|
988
|
+
lead_id: string;
|
|
989
|
+
result_class: string; // ex: 'High' | 'Medium' | 'Low'
|
|
990
|
+
confidence: number; // 0.0 – 1.0
|
|
991
|
+
score: number; // 0 – 100
|
|
992
|
+
reasoning: string; // explicação do modelo (1 linha)
|
|
993
|
+
model: string; // @cf/modelo-usado
|
|
994
|
+
latency_ms: number;
|
|
995
|
+
cached: boolean;
|
|
996
|
+
}
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
3. **System prompt do modelo** — calibrado ao caso de uso específico, com instrução de retornar JSON puro.
|
|
1000
|
+
|
|
1001
|
+
4. **Estratégia de cache** — resultado deve ser cacheado no KV (`GEO_CACHE`) por TTL definido pelo agente (padrão: 1h), usando `input_hash` como chave, para evitar rechamadas desnecessárias ao modelo.
|
|
1002
|
+
|
|
1003
|
+
---
|
|
1004
|
+
|
|
1005
|
+
**PASSO 2 — Database Agent**
|
|
1006
|
+
|
|
1007
|
+
Responsabilidade: criar schema D1 tipado e com índices corretos.
|
|
1008
|
+
|
|
1009
|
+
Schema obrigatório — **sem campos genéricos**:
|
|
1010
|
+
```sql
|
|
1011
|
+
-- Nomenclatura: schema-ai-[nome-do-módulo].sql
|
|
1012
|
+
CREATE TABLE IF NOT EXISTS ai_[nome] (
|
|
1013
|
+
id TEXT PRIMARY KEY, -- UUID v4
|
|
1014
|
+
lead_id TEXT NOT NULL,
|
|
1015
|
+
input_hash TEXT NOT NULL, -- SHA256 do input (usado como cache key)
|
|
1016
|
+
result_class TEXT NOT NULL, -- saída classificada do modelo
|
|
1017
|
+
confidence REAL NOT NULL DEFAULT 0, -- 0.0 – 1.0
|
|
1018
|
+
score INTEGER NOT NULL DEFAULT 0, -- 0 – 100
|
|
1019
|
+
reasoning TEXT, -- explicação do modelo
|
|
1020
|
+
model TEXT NOT NULL, -- @cf/modelo-usado
|
|
1021
|
+
latency_ms INTEGER, -- tempo de inferência
|
|
1022
|
+
cached INTEGER NOT NULL DEFAULT 0, -- 0 = fresh, 1 = from KV cache
|
|
1023
|
+
pipeline TEXT NOT NULL DEFAULT 'api', -- 'track' | 'api' | 'cron'
|
|
1024
|
+
created_at INTEGER NOT NULL DEFAULT (unixepoch())
|
|
1025
|
+
);
|
|
1026
|
+
|
|
1027
|
+
CREATE INDEX IF NOT EXISTS idx_ai_[nome]_lead ON ai_[nome](lead_id);
|
|
1028
|
+
CREATE INDEX IF NOT EXISTS idx_ai_[nome]_class ON ai_[nome](result_class);
|
|
1029
|
+
CREATE INDEX IF NOT EXISTS idx_ai_[nome]_created ON ai_[nome](created_at DESC);
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
Após gerar o schema, o Database Agent passa o arquivo para o DevOps Agent aplicar — **não aplica diretamente**.
|
|
1033
|
+
|
|
1034
|
+
---
|
|
1035
|
+
|
|
1036
|
+
**PASSO 3 — Server Tracking Agent**
|
|
1037
|
+
|
|
1038
|
+
Responsabilidade: criar o módulo TypeScript + rotas REST + integração ao pipeline conforme resposta da PERGUNTA OBRIGATÓRIA.
|
|
1039
|
+
|
|
1040
|
+
**Estrutura do módulo gerado:**
|
|
1041
|
+
```typescript
|
|
1042
|
+
// server-edge-tracker/modules/ml/[nome].ts
|
|
1043
|
+
|
|
1044
|
+
export async function run[Nome](
|
|
1045
|
+
env: Env,
|
|
1046
|
+
input: AIModuleInput
|
|
1047
|
+
): Promise<AIModuleOutput> {
|
|
1048
|
+
|
|
1049
|
+
// 1. Verificar cache KV antes de chamar o modelo
|
|
1050
|
+
const cacheKey = `ai:[nome]:${input.input_hash}`;
|
|
1051
|
+
const cached = await env.GEO_CACHE.get(cacheKey, 'json');
|
|
1052
|
+
if (cached) return { ...cached, cached: true };
|
|
1053
|
+
|
|
1054
|
+
// 2. Chamar Workers AI
|
|
1055
|
+
const aiRes = await env.AI.run('[modelo-escolhido]', {
|
|
1056
|
+
messages: [
|
|
1057
|
+
{ role: 'system', content: '[system-prompt-gerado-no-passo-1]' },
|
|
1058
|
+
{ role: 'user', content: JSON.stringify(input.features) }
|
|
1059
|
+
],
|
|
1060
|
+
max_tokens: 64
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
// 3. Parsear output do modelo (sempre JSON puro)
|
|
1064
|
+
const parsed = JSON.parse(aiRes.response);
|
|
1065
|
+
const output: AIModuleOutput = {
|
|
1066
|
+
lead_id: input.lead_id,
|
|
1067
|
+
result_class: parsed.class,
|
|
1068
|
+
confidence: parsed.confidence ?? 0,
|
|
1069
|
+
score: parsed.score ?? 0,
|
|
1070
|
+
reasoning: parsed.reasoning ?? '',
|
|
1071
|
+
model: '[modelo-escolhido]',
|
|
1072
|
+
latency_ms: 0, // preenchido pelo caller
|
|
1073
|
+
cached: false
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
// 4. Salvar no KV (cache) e no D1 (persistência)
|
|
1077
|
+
await env.GEO_CACHE.put(cacheKey, JSON.stringify(output), { expirationTtl: 3600 });
|
|
1078
|
+
await env.DB.prepare(`
|
|
1079
|
+
INSERT INTO ai_[nome] (id, lead_id, input_hash, result_class, confidence, score, reasoning, model, pipeline)
|
|
1080
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
1081
|
+
`).bind(crypto.randomUUID(), input.lead_id, input.input_hash, output.result_class,
|
|
1082
|
+
output.confidence, output.score, output.reasoning, output.model, input.pipeline ?? 'api')
|
|
1083
|
+
.run();
|
|
1084
|
+
|
|
1085
|
+
return output;
|
|
1086
|
+
}
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
**Rotas REST criadas (sempre, independente do modo):**
|
|
1090
|
+
```
|
|
1091
|
+
POST /api/ai/[nome] → executa inferência ad-hoc
|
|
1092
|
+
GET /api/ai/[nome]/:lead_id → retorna último resultado salvo para o lead
|
|
1093
|
+
GET /api/ai/[nome]/stats → distribuição de classes + taxa de cache hit
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
**Integração ao pipeline `/track` (somente se Modo A ou C):**
|
|
1097
|
+
```typescript
|
|
1098
|
+
// Em index.ts — dentro do handler POST /track, após Quiz Scoring e antes do CAPI Dispatch
|
|
1099
|
+
// Ordem runtime atualizada:
|
|
1100
|
+
// [1] Fraud Gate → [2] Quiz Scoring → [3] LTV → [3.x] [NOME] → [4] D1 → [5] CAPI
|
|
1101
|
+
|
|
1102
|
+
const [nomeResult] = await run[Nome](env, {
|
|
1103
|
+
lead_id: payload.userId,
|
|
1104
|
+
input_hash: await sha256(JSON.stringify(relevantFeatures)),
|
|
1105
|
+
features: relevantFeatures,
|
|
1106
|
+
pipeline: 'track'
|
|
1107
|
+
});
|
|
1108
|
+
|
|
1109
|
+
// Resultado disponível para enriquecer o CAPI dispatch
|
|
1110
|
+
payload.ai_[nome]_class = [nomeResult].result_class;
|
|
1111
|
+
payload.ai_[nome]_score = [nomeResult].score;
|
|
1112
|
+
```
|
|
1113
|
+
|
|
1114
|
+
---
|
|
1115
|
+
|
|
1116
|
+
**PASSO 4 — DevOps Agent**
|
|
1117
|
+
|
|
1118
|
+
Sequência de execução obrigatória:
|
|
1119
|
+
|
|
1120
|
+
```bash
|
|
1121
|
+
# 1. Verificar se binding [ai] já existe (não duplicar)
|
|
1122
|
+
! grep -c '\[ai\]' server-edge-tracker/wrangler.toml
|
|
1123
|
+
# Se retornar 0 → adicionar bloco [ai] binding = "AI"
|
|
1124
|
+
# Se retornar ≥1 → pular, já existe
|
|
1125
|
+
|
|
1126
|
+
# 2. Aplicar schema D1
|
|
1127
|
+
! wrangler d1 execute cdp-edge-db --file=server-edge-tracker/schema-ai-[nome].sql --remote
|
|
1128
|
+
|
|
1129
|
+
# 3. Deploy
|
|
1130
|
+
! wrangler deploy
|
|
1131
|
+
```
|
|
1132
|
+
|
|
1133
|
+
**Em caso de falha no deploy:** o DevOps Agent captura o erro, passa para o Debug Agent e tenta correção automática antes de escalar para o usuário.
|
|
1134
|
+
|
|
1135
|
+
---
|
|
1136
|
+
|
|
1137
|
+
**PASSO 5 — Validator Agent**
|
|
1138
|
+
|
|
1139
|
+
Smoke tests obrigatórios em sequência:
|
|
1140
|
+
|
|
1141
|
+
```bash
|
|
1142
|
+
# Test 1 — Inferência ad-hoc
|
|
1143
|
+
POST /api/ai/[nome]
|
|
1144
|
+
Body: { "lead_id": "smoke-test-001", "features": { [campo-principal]: [valor-teste] } }
|
|
1145
|
+
Esperado: 200 + { result_class, confidence, score, cached: false }
|
|
1146
|
+
|
|
1147
|
+
# Test 2 — Cache hit
|
|
1148
|
+
POST /api/ai/[nome] (mesmo payload)
|
|
1149
|
+
Esperado: 200 + { cached: true, latency_ms < 10 }
|
|
1150
|
+
|
|
1151
|
+
# Test 3 — Leitura do resultado
|
|
1152
|
+
GET /api/ai/[nome]/smoke-test-001
|
|
1153
|
+
Esperado: 200 + registro da tabela D1
|
|
1154
|
+
|
|
1155
|
+
# Test 4 — Stats
|
|
1156
|
+
GET /api/ai/[nome]/stats
|
|
1157
|
+
Esperado: 200 + { total, by_class: { ... }, cache_hit_rate }
|
|
1158
|
+
|
|
1159
|
+
# Test 5 — Pipeline /track (somente se Modo A ou C)
|
|
1160
|
+
POST /track com payload real
|
|
1161
|
+
Esperado: response contém ai_[nome]_class no resultado
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
Se qualquer teste falhar: **bloquear** e escalar para Debug Agent antes de entregar ao usuário.
|
|
1165
|
+
|
|
1166
|
+
---
|
|
1167
|
+
|
|
1168
|
+
### SAÍDA FINAL AO USUÁRIO
|
|
1169
|
+
|
|
1170
|
+
```
|
|
1171
|
+
⚡ Módulo AI criado: [nome-do-módulo]
|
|
1172
|
+
|
|
1173
|
+
Modelo: @cf/[modelo]
|
|
1174
|
+
Tabela D1: ai_[nome] ([N] colunas tipadas + 3 índices)
|
|
1175
|
+
Cache KV: ai:[nome]:{hash} (TTL: 1h)
|
|
1176
|
+
|
|
1177
|
+
Rotas:
|
|
1178
|
+
POST /api/ai/[nome] → inferência
|
|
1179
|
+
GET /api/ai/[nome]/:lead_id → histórico
|
|
1180
|
+
GET /api/ai/[nome]/stats → métricas
|
|
1181
|
+
|
|
1182
|
+
Pipeline /track: [INTEGRADO na posição [3.x] | NÃO INTEGRADO]
|
|
1183
|
+
|
|
1184
|
+
Smoke tests: 5/5 ✅
|
|
1185
|
+
Deploy: OK — [worker-url]
|
|
1186
|
+
```
|
|
1187
|
+
|
|
1188
|
+
---
|
|
1189
|
+
|
|
919
1190
|
## COMANDO /setup — Fluxo principal de configuração
|
|
920
1191
|
|
|
921
1192
|
### MENSAGEM DE BOAS-VINDAS (disparar na ativação do agente)
|
|
@@ -1082,9 +1353,9 @@ Exibir:
|
|
|
1082
1353
|
|
|
1083
1354
|
**Bloco EVO CRM (OAuth2)** (incluir se CRM selecionado):
|
|
1084
1355
|
> - `EVO_CRM_BASE_URL` — URL base (ex: https://api-evocrm.dominio.com)
|
|
1085
|
-
> - `EVO_CRM_CLIENT_ID` — OAuth client_id
|
|
1086
|
-
> - `EVO_CRM_CLIENT_SECRET` — OAuth client_secret
|
|
1087
|
-
> - `EVO_CRM_INBOX_ID` — ID do inbox
|
|
1356
|
+
> - `EVO_CRM_CLIENT_ID` — OAuth client_id (Configurações -> Aplicações)
|
|
1357
|
+
> - `EVO_CRM_CLIENT_SECRET` — OAuth client_secret (O segredo do app)
|
|
1358
|
+
> - `EVO_CRM_INBOX_ID` — ID numérico do inbox (final da URL da caixa)
|
|
1088
1359
|
> - `EVO_CRM_DEFAULT_COUNTRY` — Dial code default (ex: 55)
|
|
1089
1360
|
> - `EVO_CRM_LOCALE` — Locale das notas (pt-BR | en-US | es-ES)
|
|
1090
1361
|
|
|
@@ -1956,6 +2227,10 @@ Apresentar o resultado organizado com resumo de eventos e próximos passos.
|
|
|
1956
2227
|
wrangler secret put META_ACCESS_TOKEN
|
|
1957
2228
|
wrangler secret put GA4_API_SECRET
|
|
1958
2229
|
wrangler secret put TIKTOK_ACCESS_TOKEN
|
|
2230
|
+
wrangler secret put EVO_CRM_BASE_URL
|
|
2231
|
+
wrangler secret put EVO_CRM_CLIENT_ID
|
|
2232
|
+
wrangler secret put EVO_CRM_CLIENT_SECRET
|
|
2233
|
+
wrangler secret put EVO_CRM_INBOX_ID
|
|
1959
2234
|
```
|
|
1960
2235
|
|
|
1961
2236
|
3. **Testar Eventos:**
|
|
@@ -744,6 +744,26 @@ curl "https://seudominio.com/api/segmentation/outliers?limit=20"
|
|
|
744
744
|
|
|
745
745
|
---
|
|
746
746
|
|
|
747
|
+
## COMANDO *new-ai-module — Ativação por módulo genérico
|
|
748
|
+
|
|
749
|
+
Este agente também é invocado pelo Master Orchestrator quando recebe o comando `*new-ai-module` com descrição do tipo:
|
|
750
|
+
**segmentar, agrupar, cluster, similaridade, perfil, embedding, distribuição**
|
|
751
|
+
|
|
752
|
+
### Responsabilidade no PASSO 1 do pipeline *new-ai-module
|
|
753
|
+
|
|
754
|
+
Entregar obrigatoriamente ao Master Orchestrator:
|
|
755
|
+
|
|
756
|
+
1. **Modelo escolhido** — para clustering semântico: `@cf/baai/bge-m3`; para auto-labeling de segmentos: `@cf/ibm-granite/granite-4.0-h-micro`
|
|
757
|
+
2. **Estratégia de clustering** — K-means (grupos fixos) ou DBSCAN (anomalias/fraude), com `n_clusters` recomendado
|
|
758
|
+
3. **Pipeline de features** — quais campos do payload ou da tabela D1 alimentam o vetor de embedding
|
|
759
|
+
4. **Contrato de output** — `{ segment_id, segment_label, similarity_score, cluster_method }`
|
|
760
|
+
5. **TTL de cache KV recomendado** — padrão 3600s; para segmentos comportamentais usar 1800s
|
|
761
|
+
6. **Posição no pipeline `/track`** — se Modo A ou C, este módulo entra após LTV Prediction
|
|
762
|
+
|
|
763
|
+
> **Regra:** Responder com o pacote completo em uma única mensagem. Sem perguntas de volta ao Orchestrator.
|
|
764
|
+
|
|
765
|
+
---
|
|
766
|
+
|
|
747
767
|
*ML Clustering Agent v1.0 — Segmentação Dinâmica ML*
|
|
748
768
|
*Versão: 1.0 — Criado em: 9 de Abril de 2026*
|
|
749
769
|
*Status: Ready para implementação*
|
package/package.json
CHANGED