mirror of
https://github.com/hoshikawa2/agent_platform_oci.git
synced 2026-07-09 14:04:19 +00:00
first commit
This commit is contained in:
33
templates/agent_template_backend/config/agents.yaml
Normal file
33
templates/agent_template_backend/config/agents.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
default_agent_id: telecom_contas
|
||||
agents:
|
||||
- agent_id: telecom_contas
|
||||
name: Agente Telecom Contas
|
||||
description: Template de atendimento para faturas, produtos e suporte de telecom.
|
||||
prompt_policy_path: ./config/agents/telecom_contas/prompt_policy.yaml
|
||||
routing_config_path: ./config/routing.yaml
|
||||
guardrails_config_path: ./config/agents/telecom_contas/guardrails.yaml
|
||||
judges_config_path: ./config/agents/telecom_contas/judges.yaml
|
||||
mcp_servers_config_path: ./config/mcp_servers.yaml
|
||||
tools_config_path: ./config/tools.yaml
|
||||
metadata:
|
||||
domain: telecom
|
||||
system_prefix: |
|
||||
Você está executando o agent_template telecom_contas.
|
||||
Use somente políticas, memória, checkpoints, guardrails e judges deste agent_id.
|
||||
Não misture histórico ou decisões de outros agentes.
|
||||
|
||||
- agent_id: retail_orders
|
||||
name: Agente Retail Pedidos
|
||||
description: Template de varejo para pedidos, produtos, troca/devolução e garantia.
|
||||
prompt_policy_path: ./config/agents/retail_orders/prompt_policy.yaml
|
||||
routing_config_path: ./config/routing.yaml
|
||||
guardrails_config_path: ./config/agents/retail_orders/guardrails.yaml
|
||||
judges_config_path: ./config/agents/retail_orders/judges.yaml
|
||||
mcp_servers_config_path: ./config/mcp_servers.yaml
|
||||
tools_config_path: ./config/tools.yaml
|
||||
metadata:
|
||||
domain: retail
|
||||
system_prefix: |
|
||||
Você está executando o agent_template retail_orders.
|
||||
Use somente políticas, memória, checkpoints, guardrails e judges deste agent_id.
|
||||
Não misture histórico ou decisões de outros agentes.
|
||||
@@ -0,0 +1,8 @@
|
||||
input:
|
||||
- code: MSK
|
||||
enabled: true
|
||||
- code: VLOOP
|
||||
enabled: true
|
||||
output:
|
||||
- code: REVPREC
|
||||
enabled: true
|
||||
@@ -0,0 +1,7 @@
|
||||
judges:
|
||||
- name: response_quality
|
||||
enabled: true
|
||||
threshold: 0.7
|
||||
- name: groundedness
|
||||
enabled: true
|
||||
threshold: 0.6
|
||||
@@ -0,0 +1,6 @@
|
||||
id: retail_orders_prompt_policy
|
||||
version: 1
|
||||
description: Prompt base isolado do agente de varejo/pedidos.
|
||||
system_prefix: |
|
||||
Você é um agente corporativo de varejo especializado em pedidos, entrega, troca, devolução e garantia.
|
||||
Seja claro, objetivo e não use regras de negócio de telecom neste agente.
|
||||
@@ -0,0 +1,8 @@
|
||||
input:
|
||||
- code: MSK
|
||||
enabled: true
|
||||
- code: VLOOP
|
||||
enabled: true
|
||||
output:
|
||||
- code: REVPREC
|
||||
enabled: true
|
||||
@@ -0,0 +1,20 @@
|
||||
enabled: true
|
||||
fail_closed: true
|
||||
profile: judge
|
||||
|
||||
judges:
|
||||
- name: response_quality
|
||||
enabled: true
|
||||
threshold: 0.7
|
||||
|
||||
- name: groundedness
|
||||
enabled: true
|
||||
threshold: 0.6
|
||||
|
||||
- name: sentiment
|
||||
enabled: true
|
||||
fail_on_negative: false
|
||||
|
||||
- name: tone
|
||||
enabled: true
|
||||
fail_closed: true
|
||||
@@ -0,0 +1,6 @@
|
||||
id: telecom_contas_prompt_policy
|
||||
version: 1
|
||||
description: Prompt base isolado do agente de telecom/contas.
|
||||
system_prefix: |
|
||||
Você é um agente corporativo de atendimento telecom especializado em faturas, produtos, VAS e suporte.
|
||||
Seja claro, objetivo e não prometa execução operacional sem ferramenta ou confirmação válida.
|
||||
12
templates/agent_template_backend/config/guardrails.yaml
Normal file
12
templates/agent_template_backend/config/guardrails.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
input:
|
||||
- code: MSK
|
||||
enabled: true
|
||||
- code: VLOOP
|
||||
enabled: true
|
||||
output:
|
||||
- code: REVPREC
|
||||
enabled: true
|
||||
- code: PINJ
|
||||
enabled: true
|
||||
- code: DLEX_OUT
|
||||
enabled: true
|
||||
55
templates/agent_template_backend/config/identity.yaml
Normal file
55
templates/agent_template_backend/config/identity.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
identity:
|
||||
version: "2"
|
||||
required:
|
||||
- session_key
|
||||
keys:
|
||||
customer_key:
|
||||
description: Cliente/assinante/consumidor canônico.
|
||||
sources:
|
||||
- business_context.customer_key
|
||||
- customer_key
|
||||
- msisdn
|
||||
- customer_id
|
||||
- user_id
|
||||
- ani
|
||||
- from
|
||||
contract_key:
|
||||
description: Contrato, conta, fatura, pedido ou asset principal.
|
||||
sources:
|
||||
- business_context.contract_key
|
||||
- contract_key
|
||||
- invoice_id
|
||||
- current_invoice_number
|
||||
- order_id
|
||||
- pedido_id
|
||||
- asset_id
|
||||
interaction_key:
|
||||
description: Chave externa da interação/call/chat vinda do canal.
|
||||
sources:
|
||||
- business_context.interaction_key
|
||||
- interaction_key
|
||||
- ura_call_id
|
||||
- call_id
|
||||
- message_id
|
||||
account_key:
|
||||
description: Conta de cobrança/conta comercial.
|
||||
sources:
|
||||
- business_context.account_key
|
||||
- account_key
|
||||
- account_id
|
||||
- billing_account_id
|
||||
resource_key:
|
||||
description: Recurso/linha/produto/asset específico.
|
||||
sources:
|
||||
- business_context.resource_key
|
||||
- resource_key
|
||||
- asset_id
|
||||
- product_id
|
||||
- sku
|
||||
session_key:
|
||||
description: Sessão técnica estável já escopada por tenant e agente.
|
||||
sources:
|
||||
- business_context.session_key
|
||||
- session_key
|
||||
- conversation_key
|
||||
- session_id
|
||||
20
templates/agent_template_backend/config/judges.yaml
Normal file
20
templates/agent_template_backend/config/judges.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
enabled: true
|
||||
fail_closed: true
|
||||
profile: judge
|
||||
|
||||
judges:
|
||||
- name: response_quality
|
||||
enabled: true
|
||||
threshold: 0.7
|
||||
|
||||
- name: groundedness
|
||||
enabled: true
|
||||
threshold: 0.6
|
||||
|
||||
- name: sentiment
|
||||
enabled: true
|
||||
fail_on_negative: false
|
||||
|
||||
- name: tone
|
||||
enabled: true
|
||||
fail_closed: true
|
||||
@@ -0,0 +1,58 @@
|
||||
mcp_parameter_mapping:
|
||||
defaults:
|
||||
use_mock: true
|
||||
tools:
|
||||
consultar_fatura:
|
||||
map:
|
||||
customer_key: msisdn
|
||||
contract_key: invoice_id
|
||||
interaction_key: ura_call_id
|
||||
session_key: session_id
|
||||
|
||||
extract:
|
||||
mes_referencia:
|
||||
from: message
|
||||
type: int
|
||||
strategy: month_name_pt
|
||||
description: >
|
||||
Extrair mês citado na mensagem.
|
||||
janeiro=1, fevereiro=2, março=3,
|
||||
abril=4, maio=5, junho=6,
|
||||
julho=7, agosto=8, setembro=9,
|
||||
outubro=10, novembro=11, dezembro=12.
|
||||
consultar_pagamentos:
|
||||
map:
|
||||
customer_key: msisdn
|
||||
interaction_key: ura_call_id
|
||||
session_key: session_id
|
||||
consultar_plano:
|
||||
map:
|
||||
customer_key: msisdn
|
||||
resource_key: asset_id
|
||||
contract_key: asset_id
|
||||
session_key: session_id
|
||||
listar_servicos:
|
||||
map:
|
||||
customer_key: msisdn
|
||||
session_key: session_id
|
||||
consultar_pedido:
|
||||
map:
|
||||
customer_key: customer_id
|
||||
contract_key: order_id
|
||||
session_key: session_id
|
||||
consultar_entrega:
|
||||
map:
|
||||
contract_key: order_id
|
||||
session_key: session_id
|
||||
solicitar_troca:
|
||||
map:
|
||||
contract_key: order_id
|
||||
session_key: session_id
|
||||
defaults:
|
||||
reason: Solicitação aberta pelo atendimento conversacional.
|
||||
solicitar_devolucao:
|
||||
map:
|
||||
contract_key: order_id
|
||||
session_key: session_id
|
||||
defaults:
|
||||
reason: Solicitação aberta pelo atendimento conversacional.
|
||||
@@ -0,0 +1,12 @@
|
||||
servers:
|
||||
telecom:
|
||||
transport: http
|
||||
endpoint: http://telecom-mcp:8100/mcp
|
||||
enabled: true
|
||||
description: MCP Server Telecom via docker-compose.
|
||||
|
||||
retail:
|
||||
transport: http
|
||||
endpoint: http://retail-mcp:8200/mcp
|
||||
enabled: true
|
||||
description: MCP Server Retail via docker-compose.
|
||||
30
templates/agent_template_backend/config/mcp_servers.yaml
Normal file
30
templates/agent_template_backend/config/mcp_servers.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
# MCP servers registry.
|
||||
# transport=http keeps the legacy framework mock contract:
|
||||
# GET <endpoint>/tools/list
|
||||
# POST <endpoint>/tools/call
|
||||
# transport=fastmcp uses official MCP Streamable HTTP, typically endpoint http://host:port/mcp
|
||||
# transport=sse uses official MCP SSE, typically endpoint http://host:port/sse
|
||||
servers:
|
||||
# telecom:
|
||||
# enabled: true
|
||||
# transport: fastmcp
|
||||
# endpoint: http://localhost:8001/mcp
|
||||
# description: Telecom FastMCP server using official MCP protocol
|
||||
#
|
||||
# retail:
|
||||
# enabled: true
|
||||
# transport: fastmcp
|
||||
# endpoint: http://localhost:8002/mcp
|
||||
# description: Retail FastMCP server using official MCP protocol
|
||||
|
||||
telecom:
|
||||
enabled: true
|
||||
transport: http
|
||||
endpoint: http://localhost:8100/mcp
|
||||
description: Telecom legacy HTTP mock MCP server
|
||||
|
||||
retail:
|
||||
enabled: true
|
||||
transport: http
|
||||
endpoint: http://localhost:8200/mcp
|
||||
description: Retail legacy HTTP mock MCP server
|
||||
19
templates/agent_template_backend/config/prompt_policy.yaml
Normal file
19
templates/agent_template_backend/config/prompt_policy.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
tone:
|
||||
style: "claro, objetivo, empático"
|
||||
forbidden_phrases:
|
||||
- "procure atendimento humano"
|
||||
vocabulary:
|
||||
preferred:
|
||||
fatura: "fatura"
|
||||
contestacao: "contestação"
|
||||
intents:
|
||||
billing_agent:
|
||||
- fatura
|
||||
- boleto
|
||||
- cobrança
|
||||
- segunda via
|
||||
product_agent:
|
||||
- plano
|
||||
- produto
|
||||
- oferta
|
||||
- serviço
|
||||
114
templates/agent_template_backend/config/routing.yaml
Normal file
114
templates/agent_template_backend/config/routing.yaml
Normal file
@@ -0,0 +1,114 @@
|
||||
# Roteamento enterprise configurável com MCP-aware intents.
|
||||
router:
|
||||
# mode também pode ser definido por variável de ambiente ROUTING_MODE.
|
||||
# Valores: router | supervisor
|
||||
mode: router
|
||||
fallback_agent: billing_agent
|
||||
confidence_threshold: 0.65
|
||||
allow_handoff: true
|
||||
|
||||
state_policies:
|
||||
- state: WAITING_BILLING_CONFIRMATION
|
||||
agent: billing_agent
|
||||
description: Mantém mensagens curtas como "sim" ou "não" no fluxo de fatura.
|
||||
- state: WAITING_PRODUCT_CONFIRMATION
|
||||
agent: product_agent
|
||||
description: Mantém confirmações no fluxo de produtos/serviços.
|
||||
- state: WAITING_ORDER_CONFIRMATION
|
||||
agent: orders_agent
|
||||
description: Mantém confirmações no fluxo de pedidos.
|
||||
- state: WAITING_SUPPORT_CONFIRMATION
|
||||
agent: support_agent
|
||||
description: Mantém confirmações no fluxo de suporte retail.
|
||||
|
||||
intents:
|
||||
- name: billing_invoice_explanation
|
||||
domain: telecom
|
||||
agent: billing_agent
|
||||
description: Dúvidas sobre fatura, cobrança, vencimento, segunda via, contestação e valores.
|
||||
priority: 10
|
||||
mcp_tools:
|
||||
- consultar_fatura
|
||||
- consultar_pagamentos
|
||||
keywords:
|
||||
- fatura
|
||||
- conta
|
||||
- cobrança
|
||||
- boleto
|
||||
- vencimento
|
||||
- segunda via
|
||||
- contestar
|
||||
- valor alto
|
||||
- invoice
|
||||
examples:
|
||||
- Minha fatura veio alta.
|
||||
- Quero entender uma cobrança.
|
||||
- Preciso da segunda via da conta.
|
||||
|
||||
- name: product_services_information
|
||||
domain: telecom
|
||||
agent: product_agent
|
||||
description: Dúvidas sobre plano, pacote, produto, serviço, VAS, internet, roaming e benefícios.
|
||||
priority: 20
|
||||
mcp_tools:
|
||||
- consultar_plano
|
||||
- listar_servicos
|
||||
keywords:
|
||||
- plano
|
||||
- produto
|
||||
- serviço
|
||||
- pacote
|
||||
- internet
|
||||
- roaming
|
||||
- vas
|
||||
- benefício
|
||||
- assinatura
|
||||
examples:
|
||||
- Quais serviços estão ativos no meu plano?
|
||||
- Quero saber sobre meu pacote de internet.
|
||||
- Tenho roaming internacional?
|
||||
|
||||
- name: retail_order_tracking
|
||||
domain: retail
|
||||
agent: orders_agent
|
||||
description: Consulta de pedido, entrega, rastreamento, atraso e status de compra.
|
||||
priority: 30
|
||||
mcp_tools:
|
||||
- consultar_pedido
|
||||
- consultar_entrega
|
||||
keywords:
|
||||
- pedido
|
||||
- entrega
|
||||
- rastreio
|
||||
- rastreamento
|
||||
- encomenda
|
||||
- compra
|
||||
- atraso
|
||||
- correios
|
||||
examples:
|
||||
- Meu pedido não chegou.
|
||||
- Quero rastrear minha entrega.
|
||||
- Qual é o status da minha compra?
|
||||
|
||||
- name: retail_support_exchange_return
|
||||
domain: retail
|
||||
agent: support_agent
|
||||
description: Suporte, troca, devolução, garantia e problema com produto.
|
||||
priority: 40
|
||||
mcp_tools:
|
||||
- consultar_pedido
|
||||
- solicitar_troca
|
||||
- solicitar_devolucao
|
||||
keywords:
|
||||
- troca
|
||||
- devolução
|
||||
- devolver
|
||||
- garantia
|
||||
- defeito
|
||||
- produto quebrado
|
||||
- suporte
|
||||
- arrependimento
|
||||
examples:
|
||||
- Quero trocar um produto.
|
||||
- Meu produto veio com defeito.
|
||||
- Como faço uma devolução?
|
||||
68
templates/agent_template_backend/config/tools.yaml
Normal file
68
templates/agent_template_backend/config/tools.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
tools:
|
||||
consultar_fatura:
|
||||
description: Consulta dados resumidos de fatura por msisdn/invoice_id.
|
||||
mcp_server: telecom
|
||||
enabled: true
|
||||
args_schema:
|
||||
msisdn: string
|
||||
invoice_id: string
|
||||
|
||||
consultar_pagamentos:
|
||||
description: Consulta histórico de pagamentos do cliente.
|
||||
mcp_server: telecom
|
||||
enabled: true
|
||||
args_schema:
|
||||
msisdn: string
|
||||
|
||||
consultar_plano:
|
||||
description: Consulta plano ativo e atributos comerciais.
|
||||
mcp_server: telecom
|
||||
enabled: true
|
||||
args_schema:
|
||||
msisdn: string
|
||||
asset_id: string
|
||||
|
||||
listar_servicos:
|
||||
description: Lista serviços ativos e adicionais VAS.
|
||||
mcp_server: telecom
|
||||
enabled: true
|
||||
args_schema:
|
||||
msisdn: string
|
||||
|
||||
consultar_pedido:
|
||||
description: Consulta pedido de varejo por order_id/customer_id.
|
||||
mcp_server: retail
|
||||
enabled: true
|
||||
args_schema:
|
||||
order_id: string
|
||||
customer_id: string
|
||||
|
||||
consultar_entrega:
|
||||
description: Consulta entrega e rastreamento do pedido.
|
||||
mcp_server: retail
|
||||
enabled: true
|
||||
args_schema:
|
||||
order_id: string
|
||||
|
||||
solicitar_troca:
|
||||
description: Simula abertura de solicitação de troca.
|
||||
mcp_server: retail
|
||||
enabled: true
|
||||
tool_type: action
|
||||
requires: [order_id, reason]
|
||||
confirmation_required: false
|
||||
args_schema:
|
||||
order_id: string
|
||||
reason: string
|
||||
|
||||
solicitar_devolucao:
|
||||
description: Simula abertura de solicitação de devolução.
|
||||
mcp_server: retail
|
||||
enabled: true
|
||||
tool_type: action
|
||||
requires: [order_id, reason]
|
||||
confirmation_required: false
|
||||
args_schema:
|
||||
order_id: string
|
||||
reason: string
|
||||
|
||||
Reference in New Issue
Block a user