# Protocolo de Knowledge Sources v2.0 **Data:** 2026-02-12 **Propósito:** Consulta inteligente de conhecimento com dual-source (NotebookLM + Dify KB) --- ## Visão Geral Skills e agents consultam conhecimento via dual-source: 1. **NotebookLM** (primario) - Gemini 2.5 RAG com conhecimento curado 2. **Dify KB** (fallback) - Datasets tematicos quando NotebookLM insuficiente ## Fluxo de Consulta ``` 1. Skill/Agent precisa conhecimento 2. Consultar NotebookLM (primario) → mcp__notebooklm__notebook_query notebook_id:"" query:"" 3. Se resultado suficiente → usar 4. Se insuficiente → consultar Dify KB (fallback) → mcp__dify-kb__dify_kb_retrieve_segments dataset:"" query:"" 5. Agregar resultados ``` ## Como Consultar NotebookLM (Primario) ### 1. Identificar Notebook (via notebooklm-mapping.json) ```javascript // Ler mapeamento const mapping = require('./notebooklm-mapping.json').mapping; const notebook = mapping['WordPress']; // → {notebook_id: "5be0d1a6-...", notebook_title: "WordPress e Elementor"} ``` ### 2. Consultar Notebook ``` mcp__notebooklm__notebook_query notebook_id:"5be0d1a6-00f2-4cd9-b835-978cb7721601" query:"elementor custom widgets" ``` ### 3. Múltiplos Notebooks Quando o tema cobre vários notebooks, consultar em paralelo: ``` # Paralelo: WordPress + Dev mcp__notebooklm__notebook_query notebook_id:"5be0d1a6-..." query:"tema" mcp__notebooklm__notebook_query notebook_id:"24947ffa-..." query:"tema" ``` ## Como Consultar Dify KB (Fallback) ### 1. Identificar Dataset ```javascript mcp__dify-kb__dify_kb_retrieve_segments({ dataset: "WordPress", query: "elementor custom widgets", top_k: 5 }); ``` ### 2. Consulta Paralela (Múltiplos Datasets) ```javascript // Lançar consultas em paralelo para datasets prioritarios const results = await Promise.all([ dify_kb_retrieve(dataset1, query), dify_kb_retrieve(dataset2, query) ]); ``` ## Mapeamento Notebooks Ficheiro central: `notebooklm-mapping.json` (mesmo directorio) 51 notebooks disponiveis cobrindo: - Marketing (5 notebooks) - Desenvolvimento (8 notebooks) - Infraestrutura (3 notebooks) - Gestao (3 notebooks) - Negocio (4 notebooks) - Automacao (3 notebooks) - Design (2 notebooks) ## Template para Agents Secção standard nos agents: ```markdown ## Knowledge Sources (Consultar SEMPRE) ### NotebookLM (Primario - usar PRIMEIRO) ``` mcp__notebooklm__notebook_query notebook_id:"" query:"" ``` ### Dify KB (Secundario - se NotebookLM insuficiente) ``` mcp__dify-kb__dify_kb_retrieve_segments dataset:"" query:"" ``` ``` ## Template para Skills Adicionar no SKILL.md: ```markdown # PRIMARIO: NotebookLM (Gemini 2.5 RAG) # mcp__notebooklm__notebook_query notebook_id:"" # FALLBACK: Dify KB mcp__dify-kb__dify_kb_retrieve_segments dataset:"" query:"" ``` ## Metricas Rastrear na instrumentacao: - `kb_source`: "notebooklm" ou "dify" - `kb_consulted`: 1 se consultou KB - `kb_fallback`: 1 se precisou de Dify apos NotebookLM --- **Protocolo v2.0** | 2026-02-12 | Dual-source (NotebookLM + Dify KB)