From 2a99eb9c1649508321964bb3a744983164e94cdb Mon Sep 17 00:00:00 2001 From: VPS 4 Builder Date: Sun, 28 Jun 2026 16:53:50 +0200 Subject: [PATCH] docs(fase4): sync-knowledge end-to-end ok + RAG indexou (4 chunks Gemini 768d) Co-Authored-By: Claude Opus 4.8 --- projetos/newwhats.clube67.com/integracao-satelites.md | 11 ++++++++++- projetos/newwhats.clube67.com/tarefas.md | 6 ++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/projetos/newwhats.clube67.com/integracao-satelites.md b/projetos/newwhats.clube67.com/integracao-satelites.md index 6ca9663..54cfa94 100644 --- a/projetos/newwhats.clube67.com/integracao-satelites.md +++ b/projetos/newwhats.clube67.com/integracao-satelites.md @@ -74,7 +74,16 @@ usado, **reconciliar a chave** (não afeta a Fase 4, que é Satélite → Motor). - ⚠️ `api_token` não existe em `plugin_configs` do satélite — não é necessário: o ext-api autentica por `x-nw-key` (= `integration_key`), não por Bearer separado. -4. ⏳ **Conhecimento**: rodar `sync-knowledge` end-to-end (satélite → motor). +4. ✅ **Conhecimento**: `sync-knowledge` rodado end-to-end (28/jun/2026). Driver + executou o `buildKnowledgeText` real do satélite (DB `mercado`@VPS3: 2 clubes, + 4 planos, 6 promoções → 1895 chars) e publicou no motor dev via + `/api/secretaria` (nginx-dev :8022 → backend, rotas internas sem auth). Nó + `knowledge` **atualizado**. **RAG indexou**: `sec_knowledge_chunks` = 4 chunks + do nó, todos com embedding Gemini (768d). ✅ pipeline ok. + - ⚠️ A **geração final** do LLM (`gemini-2.0-flash:generateContent`) retorna + **429 quota** (free tier) — billing da chave Gemini, não defeito do pipeline. + - Corrigido de quebra: `/secretaria/ask` filtrava `prisma.chat` por `remoteJid` + (inexistente) → 500; agora usa `jid`. 5. **Mover recursos para o motor** (genéricos a todos os satélites): - ✅ **Transcrição** (áudio→texto, imagem→descrição) já no motor via Gemini (`messages.transcription`). O `media-transcribe.js` do satélite vira redundante. diff --git a/projetos/newwhats.clube67.com/tarefas.md b/projetos/newwhats.clube67.com/tarefas.md index 0ea459f..5d41220 100644 --- a/projetos/newwhats.clube67.com/tarefas.md +++ b/projetos/newwhats.clube67.com/tarefas.md @@ -22,8 +22,10 @@ (`secret` len 64, url `127.0.0.1:4001`, eventos ok). Topologia co-locada; live ponta-a-ponta exige satélite rodando co-locado. ⚠️ `/nw/*` usa chave diferente (`nwk_…1039`) — reconciliar se esse sentido for usado. -- [ ] **Fase 4** — Rodar `sync-knowledge` end-to-end (satélite → motor) e validar RAG. - _Bloqueado: requer satélite rodando + Fase 3._ +- [x] **Fase 4** — `sync-knowledge` rodado end-to-end (driver com `buildKnowledgeText` + real do satélite `mercado`@VPS3 → motor dev). Nó `knowledge` atualizado; RAG + indexou 4 chunks com embedding Gemini 768d. ⚠️ geração LLM em 429 quota + (billing). Fix de brinde: `/secretaria/ask` `remoteJid`→`jid`. - [ ] **Fase 5** — Satélite consumir `messages.transcription` do motor e **remover `media-transcribe.js`** redundante. Unificar fonte da chave Gemini (`cfg.gemini_key` vs `process.env.GEMINI_API_KEY`).