rag-assistente-conhecimento

RAG assistant for company knowledge: guidance for creating a retrieval-augmented generation (RAG) assistant built on corporate knowledge.

Last repository push
GitHub Stars
161
Forks
9
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "rag-assistente-conhecimento" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7c8cab2a439687de337606d0926c89222f551b7508d396ab3b170eab78c89a62. Verify the upstream source and version against https://github.com/Hermes-brasil/hermes-brasil before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

RAG assistant for company knowledge: guidance for creating a retrieval-augmented generation (RAG) assistant built on corporate knowledge.

0 Downloads

Introduction source: third_party · Hermes-brasil · 0.0.1 Reference

SkillPi interpretation

Tasks
Criar assistente RAG com conhecimento da empresa.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: rag-assistente-conhecimento
description: Criar assistente RAG com conhecimento da empresa.

RAG — Assistente de Conhecimento (Retrieval-Augmented Generation)

O que é: técnica que permite IA acessar conhecimento EXTERNO (documentos, FAQ, banco de dados da empresa) para dar respostas precisas e baseadas nos dados do cliente — em vez de respostas genéricas do modelo.

Conceitos-chave

📋 PIPELINE DE RAG:
├── 1. INGESTÃO: carregar documentos
├── 2. INDEXAÇÃO: dividir em chunks + gerar embeddings
├── 3. RETRIEVAL: buscar chunks relevantes à pergunta
└── 4. GERAÇÃO: modelo responde usando o contexto recuperado

Técnicas avançadas (aplicar conforme necessidade)

├── Query Translation: melhorar a pergunta antes de buscar
│   ├── Multi-Query (várias versões da pergunta)
│   ├── RAG Fusion (combina resultados)
│   ├── Decomposition (quebra pergunta complexa)
│   ├── Step Back (pergunta mais geral)
│   └── HyDE (gera resposta hipotética para buscar)
├── Routing: direcionar pergunta ao modelo/fluxo certo
├── Indexing avançado: RAPTOR, ColBERT
├── CRAG (Conditional RAG): corrigir retrieval com base no grau de confiança
└── Adaptive RAG: decide quando buscar mais dados ou responder direto

Embeddings

  • Convertem texto em vetores numéricos (capturam significado)
  • Similaridade de COSSENO (padrão), Euclidiana, Dot Product
  • Modelos: OpenAI, Gemini, Cohere, open source (sentence-transformers)
  • pt-BR: paraphrase-multilingual-MiniLM-L12-v2 (entende português)
  • CRÍTICO: usar o MESMO modelo para documentos e perguntas
from sentence_transformers import SentenceTransformer
modelo = SentenceTransformer("paraphrase-multilingual-MiniLM-L12-v2")
doc = modelo.encode("Horário de funcionamento da clínica")
pergunta = modelo.encode("A que horas abre?")

Chunking — lição importante

NÃO dividir por contagem de palavras (mistura assuntos e recupera seção errada). Dividir por SEÇÕES temáticas (títulos ##), cada seção vira um chunk com o título prefixado como contexto: f"{titulo}: {corpo}". Isso mantém cada chunk coerente e a busca fica muito mais precisa.

def chunking_por_secoes(texto):
    """Divide texto em seções (##) em vez de cortar por palavras."""
    secoes = []
    atual = {"titulo": "geral", "corpo": []}
    for linha in texto.splitlines():
        if linha.startswith("## "):
            if atual["corpo"]:
                secoes.append(atual)
            atual = {"titulo": linha[3:].strip(), "corpo": []}
        elif linha.strip():
            atual["corpo"].append(linha.strip())
    if atual["corpo"]:
        secoes.append(atual)
    return [f"{s['titulo']}: {' '.join(s['corpo'])}" for s in secoes if s["corpo"]]

Busca semântica (retrieval)

import numpy as np

def buscar(pergunta, chunk_embeddings, textos, top_k=3):
    q = modelo.encode(pergunta)
    scores = [np.dot(q, c) / (np.linalg.norm(q) * np.linalg.norm(c)) for c in chunk_embeddings]
    melhores = np.argsort(scores)[-top_k:][::-1]
    return [(textos[i], scores[i]) for i in melhores]

Fluxo de trabalho (para cliente real)

⚙️ IMPLEMENTAÇÃO:
├── 1. Levantar os documentos do cliente (FAQ, políticas, catálogo)
├── 2. Estruturar o conteúdo (seções claras)
├── 3. Rodar chunking + embeddings
├── 4. Testar busca com perguntas reais
├── 5. Conectar geração (API do modelo)
├── 6. Integrar ao canal (WhatsApp/site)
├── 7. Testar respostas e ajustar
├── 8. Definir limite (quando passar para humano)
└── 9. Manutenção e atualização do conhecimento

Venda como serviço (preços de referência)

💰 PRECIFICAÇÃO:
├── Chatbot básico: R$ 1.000-3.000
├── Assistente RAG completo: R$ 3.000-8.000
├── Assistente avançado (multi-função): R$ 8.000-15.000
├── Manutenção mensal: R$ 500-2.000
└── Licença/uso recorrente: R$ 300-1.500/mês

Pitfalls

  • Chunking por seção, não por palavra (crítico para qualidade)
  • Embeddings locais = busca sem custo; usar modelo multilingue para pt-BR
  • Testar sempre com perguntas reais do cliente
  • Definir limite claro de quando passar para atendimento humano
  • Proteger dados sensíveis (LGPD) — não vazar informações confidenciais
  • Atualizar o conhecimento periodicamente
  • Transparência: avisar que é assistente de IA

Quando usar

  • Cliente pede chatbot/assistente inteligente
  • Criar produto/ebook de RAG (tema com demanda)
  • Quer diferenciar de chatbot genérico

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供完整的RAG技术实现流程,涵盖从文档摄入到生成响应的全链路指导
  • 包含针对葡萄牙语环境的embedding模型推荐(chunking策略),具备实际落地价值
  • 给出具体定价参考和维护要点,对服务商业化有直接帮助
Trigger Precision65/100

Areas to improve

  • Description in the wrong location Reported severity: Minor

    顶层frontmatter中description字段为空,实质性触发描述出现在skill_body内部

    Recommendation: 将核心功能描述移至顶层frontmatter的description字段,确保平台能正确识别Skill用途

Highlights

  • 触发词覆盖了RAG助手的核心能力范围,包括文档检索、语义搜索等关键场景
Structure and Standards82/100

Areas to improve

  • Document is too long Reported severity: Minor

    单文件内容超过500行,影响可读性和维护性

    Recommendation: 考虑将高级技巧、代码示例等内容拆分到独立文件并通过引用方式组织

Highlights

  • Phase划分清晰,包含pipeline各阶段说明和端到端工作流示例
  • 提供了chunking、embedding、retrieval等关键环节的具体实现代码
Execution Reliability73/100

Areas to improve

  • 异常处理不足 Reported severity: Major

    代码示例未覆盖主要异常场景如API调用失败、数据格式错误、embedding生成失败等

    Recommendation: 在关键函数中添加try-catch机制,定义明确的错误码和降级策略,特别是不可逆操作需增加确认机制

Highlights

  • 工具来源相对明确(sentence-transformers库),参数设置合理且符合最佳实践
  • 强调了使用相同embedding模型的关键要求,避免常见陷阱
Evidence Verifiability (mean of the first four)75/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.