Resumen
Voice agents construido in n8n lack en tiempo real knowledge porque el underlying LLM tiene un fixed training cutoff. Este flujo de trabajo agrega un search enriquecimiento paso to n8n voice agent pipelines: cuando el agent encounters un factual question, n8n activa un HTTP Solicitud node to Scavio, retrieves structured resultados, y injects them en el agent's context antes de it responds. Latency stays bajo 3 segundos, fitting dentro de natural conversation pauses.
Desencadenador
Webhook de voice agent plataforma (Vapi, Retell) cuando factual question detectado
Programación
On demand (webhook activar)
Pasos del flujo de trabajo
Recibir voice agent consulta
n8n webhook recibe el transcribed question de el voice agent plataforma a lo largo de con sesion context.
Clasificar consulta tipo
Use un IF node to verificar if el consulta requiere en tiempo real datos (prices, horas, news) o puede be answered de training datos.
Search for actual datos
For en tiempo real consultas, call Scavio's API via HTTP Solicitud node. Choose plataforma basado on consulta tipo (Google for general, Amazon for productos).
Format for voice respuesta
Extraer el mas relevante fragmento y formato it as un speakable respuesta bajo 200 characters.
Return enriquecido context
Enviar el formatted search resultado back to el voice agent plataforma to incluye in el LLM's context for respuesta generation.
Implementacion en Python
# n8n HTTP Request node configuration:
# Method: POST
# URL: https://api.scavio.dev/api/v1/search
# Headers: x-api-key = {{$credentials.scavioApiKey}}
# Body: {"platform": "google", "query": "{{$json.transcribed_question}}"}
#
# n8n Function node to format for voice:
# const r = $input.first().json;
# const aio = r.ai_overview;
# let answer = '';
# if (aio && aio.text) {
# answer = aio.text.substring(0, 200);
# } else if (r.organic && r.organic.length > 0) {
# answer = r.organic[0].snippet.substring(0, 200);
# }
# return [{ json: { voice_response: answer } }];
# Python equivalent for testing:
import requests, os
H = {"x-api-key": os.environ["SCAVIO_API_KEY"]}
def voice_search(question, platform="google"):
r = requests.post("https://api.scavio.dev/api/v1/search", headers=H,
json={"platform": platform, "query": question, "ai_overview": True}, timeout=5).json()
aio = r.get("ai_overview")
if aio and aio.get("text"):
return aio["text"][:200]
organic = r.get("organic", [])
if organic:
return organic[0].get("snippet", "")[:200]
return "I could not find that information right now."
print(voice_search("what is the current price of bitcoin"))Implementacion en JavaScript
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function voiceSearch(question, platform = "google") {
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform, query: question, ai_overview: true})
}).then(r => r.json());
if (r.ai_overview?.text) return r.ai_overview.text.slice(0, 200);
const top = (r.organic || [])[0];
return top ? (top.snippet || "").slice(0, 200) : "I could not find that information right now.";
}Plataformas utilizadas
Búsqueda web con grafo de conocimiento, PAA y resúmenes de IA
Amazon
Búsqueda de productos con precios, calificaciones y reseñas
Comunidad, publicaciones y comentarios en hilos de cualquier subreddit