Agentes de voz em tempo real com inteligência de ponta — Bohan Li, EliseAI
Autoria: AI Engineer · Assistir no YouTube
Vídeo de autoria do canal indicado, não da IANIA; todos os direitos pertencem ao criador. Transcrição, resumo e tradução gerados automaticamente; o conteúdo no idioma original é preservado na versão em idioma original.
Idioma original: inglês
Vídeo original: Realtime Voice Agents with Frontier Intelligence — Bohan Li, EliseAI · Canal: AI Engineer · 12:30 · Assistir no YouTube
Tópicos: Agentes de IA, Avaliação e benchmarks de IA, Modelos multimodais
Bohan Li apresenta a arquitetura de harness da Xnor.ai para criar agentes de voz em tempo real sem abrir mão da inteligência de modelos avançados. O sistema combina transcrição rápida e correção contextual, geração antecipada com tool calling em segundo plano e síntese de fala com cache de prefixos para reduzir a latência. Uma chamada demonstrativa mostra o agente atendendo uma paciente e agendando uma consulta. Ao final, Li apresenta a EliseAI e sua atuação em áreas como moradia e saúde.
Pontos-chave
Seção intitulada “Pontos-chave”- A arquitetura de agentes de voz em cascata separa percepção, planejamento e controle, em paralelo à organização de sistemas de direção autônoma.
- Um transcriber especulativo combina uma transcrição rápida em streaming com uma transcrição em lote mais lenta e precisa, que corrige o texto com mais contexto.
- Agentes em segundo plano fazem tool calling e devolvem os resultados ao agente principal, reduzindo as inferências necessárias e as viagens de ida e volta.
- A geração antecipada do agente pode ser cancelada e refeita quando chegam transcrição corrigida e dados obtidos pelas ferramentas.
- O prefix cache reaproveita áudio já gerado para prefixos de texto frequentes e o envia antes de a geração completa terminar.
- O áudio restante é gerado por Cartesia; a saída duplicada é suprimida para que a transição entre o áudio em cache e o novo pareça contínua.
- Na demonstração, o agente conversa com uma paciente, coleta informações, envia um link para dados do seguro e agenda uma ultrassonografia.
- O objetivo do trabalho no harness é tornar a conversa natural, com respostas rápidas sem sacrificar a inteligência.
Capítulos
Seção intitulada “Capítulos”| Início | Capítulo | Resumo |
|---|---|---|
| 00:01 | Arquitetura em cascata para agentes de voz | Bohan Li compara agentes de voz a sistemas de direção autônoma e descreve as etapas de percepção, planejamento e controle. |
| 02:08 | Transcrição e tool calling em segundo plano | A palestra explica a combinação de transcrição rápida e precisa, além da geração antecipada do agente com chamadas de ferramentas em segundo plano. |
| 05:54 | Síntese de fala com prefix cache | O agente gera texto em streaming e usa áudio em cache junto com Cartesia para começar a falar antes da resposta completa. |
| 09:47 | Demonstração da chamada e apresentação da EliseAI | Uma chamada demonstra o agente marcando uma consulta, seguida de comentários sobre o harness e a atuação da EliseAI. |
Citações
Seção intitulada “Citações”Agentes de voz em cascata fazem muito sentido quando você os vê pela lente de dividir o sistema em percepção. — 00:32
Antes de o agente terminar de gerar o texto completo, você pode fazer o áudio tocar. — 06:30
Há muito esforço que pode ser feito no harness para realmente conseguir uma conversa natural. — 11:26
Conceitos e entidades
Seção intitulada “Conceitos e entidades”- cascaded voice agents (conceito): Arquitetura de agentes de voz que divide o processamento em etapas de percepção, planejamento e controle.
- streaming speculative transcriber (conceito): Estratégia que combina transcrição rápida em streaming com uma transcrição mais lenta e precisa para corrigir resultados com contexto.
- prefix caching (conceito): Cache que reutiliza áudio previamente gerado para sequências iniciais de palavras e pode reproduzi-lo antes de a resposta completa estar pronta.
- Flux (ferramenta): Transcriber de streaming rápido usado na camada inicial de transcrição.
- Scribe V2 (ferramenta): Sistema de transcrição em lote que usa mais contexto para produzir detecções mais precisas.
- Cartesia (empresa): Provedor de text-to-speech com suporte a WebSocket, usado para gerar áudio a partir do texto do agente.
- Xnor.ai (empresa): Empresa cuja arquitetura de harness para agentes de voz é apresentada na palestra.
- EliseAI (empresa): Empresa apresentada por Bohan Li, com atuação em áreas como moradia e saúde.
- Bohan Li (pessoa): Apresentador da palestra sobre agentes de voz em tempo real.
Tradução completa (pt-BR)
Seção intitulada “Tradução completa (pt-BR)”00:01 [música] >> Meu nome é Bo. Vou apresentar agentes de voz em tempo real com inteligência de fronteira. Basicamente, vou falar um pouco sobre como nós, na Xnor.ai, arquitetamos nosso harness de agente de voz para obter voz em tempo real com o nível de inteligência de fronteira de que precisamos.
00:32 Certo. Antes de começar, acho que queria traçar alguns paralelos sobre por que decidimos usar agentes de voz em cascata, especialmente comparando isso com carros autônomos, área em que trabalhei antes. Para mim, os agentes de voz em cascata fazem muito sentido quando você os analisa pela perspectiva de dividi-los em percepção — nos carros autônomos, isso envolve, sabe, as caixas delimitadoras, a câmera, o lidar.
01:03 Para voz, é a transcrição. Basicamente, é transformar esses sinais do mundo real em elementos de dados que o modelo de linguagem, ou qualquer cérebro com que você esteja trabalhando, possa processar. A segunda etapa é o planejamento, que é bem direta. É aqui que o modelo de linguagem recebe as saídas da etapa de percepção e produz as saídas que você quer devolver ao mundo real.
01:34 E, por fim, há a camada de controle. Nos carros autônomos, você pegaria a trajetória produzida pelo planejador e a transformaria nos controles reais para, sabe, fazer o carro andar. Aqui, transformamos o texto em áudio, que usamos para expressar os pensamentos do nosso agente de voz. E, sim, vou me aprofundar em cada um desses elementos, e fizemos alguns truques interessantes em cada uma dessas áreas para
02:08 melhorar a velocidade dos nossos agentes de voz sem sacrificar a inteligência. O primeiro elemento é a camada de transcrição. Então, criamos um conceito chamado transcritor especulativo em streaming, em que, basicamente, colocamos um transcritor rápido em streaming, como o Flux, por cima — ou, de certa forma, abaixo — de um scribe V2 ou de uma transcrição em lote precisa, que usa mais contexto. Ela é um pouco mais lenta, mas fornece detecções mais precisas.
02:39 Vamos analisar um cenário. Neste caso, o agente acabou de perguntar: “Você pode informar seu nome e sua data de nascimento?”, e o usuário vai dizer isto. Vamos ver como isso se desenrola em termos de tempo. Primeiro, vamos obter a detecção curta. Vamos obtê-la da camada em streaming. A camada precisa — a camada corretiva — não vai ser ativada porque o texto é o mesmo. Vamos receber mais detecções de texto em streaming e, neste caso, a camada corretiva é, na verdade,
03:11 cancelada porque recebemos um texto novo. Então, mais contexto, mais áudio vão prevalecer sobre a detecção precisa anterior. E é aqui que surge a primeira correção. Como a camada scribe V2 entende o contexto da pergunta, ela consegue entender que estamos falando de um nome e que isto é uma data de nascimento. Depois vêm mais algumas detecções; são apenas pontuação, então não nos importamos com elas. No fim, liberamos esse texto para o agente. E, passando para a camada do modelo de linguagem,
03:46 como estamos usando esses LLMs lentos, mas inteligentes, queremos reduzir o número de idas e voltas, e o que nos leva a fazer muitas inferências é o tool calling. Uma maneira de evitar isso é deixar agentes em segundo plano fazerem o tool calling por você e inserirem as ferramentas de volta no contexto do agente principal, para que ele pense que fez a chamada da ferramenta, embora, na verdade, não tenha feito.
04:18 Então, lembrando as detecções anteriores: cada uma dessas detecções vai acionar uma geração antecipada do agente, mas não vamos emitir o resultado até confirmarmos que o usuário terminou de falar. Neste caso, o usuário diz: “Claro.” O agente meio que sabe que o usuário está prestes a dizer outra coisa. O nosso tool calling em segundo plano, que vai nos ajudar a descobrir o nome e a data de nascimento a partir da detecção do
04:50 usuário, não é acionado. Então, não acontece muita coisa. A próxima detecção instantânea chega. Ela diz que ainda não é bem um nome. Nosso agente acompanha e continua. Agora, chega mais contexto. O agente sente que deveria haver um nome. Vai pedir que a pessoa soletre, porque provavelmente está pensando que há um erro de transcrição. Ainda não há nome nem data de nascimento. E, por fim, esta — lembrem-se — é a nossa detecção instantânea final, corrigida,
05:22 do transcritor Scribe V2. Aqui, a geração antecipada do agente, feita sem chamadas de ferramenta, vai ser cancelada porque o agente em segundo plano finalmente consegue encontrar o nome e a data de nascimento que está procurando. Então, ele vai ser acionado novamente e agora o agente tem o contexto de que precisa. E vocês veem aqui que estamos fazendo um pouco de inteligência nessa chamada de ferramenta. Vamos corrigir transcrições incorretas de nomes e fazer
05:54 uma correspondência fonética. E, depois que entendermos que essa é a fala final do usuário, vamos emitir o resultado. Bem padrão. Certo, a próxima camada é a conversão de texto em fala. O objetivo da conversão de texto em fala é pegar o que o agente disse — e o agente vai emitir isso em streaming — e produzir áudio o mais rápido possível. Idealmente, você pode fazer o áudio começar a
06:30 ser reproduzido antes mesmo de o agente terminar de gerar o texto completo, ocultando assim a latência de concluir a geração. Agora vou reproduzir a saída do agente em streaming. Começa com “você”. E, na verdade, antes de continuar, há um novo conceito que estamos introduzindo aqui, chamado cache de prefixo. O cache de prefixo vai analisar o fluxo do agente e verificar se já geramos áudio para essa sequência de palavras em uma geração anterior, ou talvez na mesma
07:04 geração desta chamada também. Então, ele vê a palavra “você”. Para esse cache de prefixo, não queremos acioná-lo imediatamente a cada palavra. Vamos esperar por mais algumas palavras. Depois de três palavras, o cache de prefixo tem o primeiro acerto. E aqui à direita está o nosso provedor padrão de conversão de texto em fala: a Cartesia é um mecanismo de conversão de texto em fala com suporte a WebSocket. Então, encaminhamos o
07:38 agente pelo cache e também pelo WebSocket. Chegam mais tokens, mais cache, mais envio pelo WebSocket. Nada de especial aqui. Certo, agora temos a primeira coisa única: encontramos o token que causa uma falha de cache. E faz sentido. Se armazenamos em cache gerações anteriores, “você disse que seu nome é” é algo bem comum, mas, quando acrescentamos o
08:08 nome, de repente isso resulta em uma falha de cache. Nesse momento, vamos emitir o áudio armazenado em cache. “Você disse que seu nome é” vai ser emitido enquanto o restante do texto em streaming chega. Nesse ponto, o usuário ouve o agente e não sabe muito bem o que está acontecendo. Para ele, parece apenas que o tempo de resposta é muito rápido. Agora, o texto restante continua chegando. Nesse ponto, já emitimos o conteúdo do cache. O cache cumpriu sua função. O restante podemos simplesmente descartar
08:42 para a Cartesia. E aqui está meio que o truque: a Cartesia viu a transcrição inteira até este ponto. Para a Cartesia, é como se esse cache de prefixo não existisse. Ela simplesmente vai gerar a frase inteira com uma prosódia natural padrão. Mas o que fazemos é: quando a geração volta, como já reproduzimos o áudio até aqui, podemos suprimir o áudio da Cartesia nessa parte e reproduzir apenas o que falta. Então,
09:15 para o usuário, pode haver uma pequena falha. Vou reproduzir um áudio mais tarde, e vocês vão perceber que provavelmente nem vão notar. Na prática, pegamos isso — ou melhor, pegamos esta parte — e a emitimos logo depois que este áudio termina de tocar. Assim, para o usuário, tudo parece contínuo. E é isso. Acho que, neste ponto, já entramos em muitos detalhes técnicos. Quer dizer, o melhor jeito é simplesmente fazer uma ligação e ver
09:47 ver isso em ação. Aqui, gravei uma ligação. Vamos ouvir o que acontece. >> Bo OBGYN, Elise falando. >> Oi, acho que talvez esteja grávida e quero marcar um ultrassom para confirmar. >> Que notícia empolgante. Você pode informar seu nome e data de nascimento? >> Claro, sou Elise Trial. Minha data de nascimento é 23/03.
10:21 >> Obrigada. Você já é nossa paciente? >> Sim. >> Boas-vindas à Bo OBGYN. Posso enviar por mensagem um link para você carregar as informações do seu seguro? >> Claro. >> Certo, enviei. Avise-me quando receber. Recebi as informações do seu seguro. O horário mais cedo que tenho
10:52 é quinta-feira, 2 de julho, às 10h. >> Na verdade, espere um segundo. Vou verificar minha agenda. >> Claro, fique à vontade. >> Você tem algum horário para a semana que vem? >> Para a semana que vem, posso oferecer um ultrassom com a Dra. Avery Stone na North Clinic, na terça-feira, 7 de julho, às 14h ou às 15h. Algum desses horários funciona para você? >> Sim, às 14h funciona. >> Ótimo. Sua consulta foi marcada.
11:26 Esperamos você. >> Obrigada. Tchau. >> Certo. É isso, basicamente. Dá para perceber todo esse streaming e que muita coisa está acontecendo em segundo plano. E é isso que torna os agentes de voz interessantes. Há muito trabalho que pode ser feito no harness para realmente conseguir uma conversa natural, que é o que
11:57 queremos. Certo. Então, para concluir, quero falar um pouco sobre a Elise. Nossa sede fica em Nova York e estamos tentando ampliar nossa presença aqui na Bay Area. Acho que somos talvez um tipo diferente de empresa daquela que as pessoas imaginam quando pensam em startups de IA em São Francisco. Somos muito focados em ajudar as pessoas e em estar presentes onde elas precisam, em algumas das áreas mais essenciais da vida. Trabalhamos com moradia, saúde e estamos indo muito bem. Aqui há um link para você se juntar à nossa equipe, e vamos publicar bastante no Twitter. Você também pode nos seguir em EliseAI. É isso.
12:30 pessoas onde elas precisam, em algumas das áreas mais críticas da vida. Trabalhamos com moradia e saúde, e estamos indo muito bem. E, sabe, aqui tem um link para você se juntar à nossa equipe. Também vamos publicar bastante no Twitter, então você pode nos seguir em EliseAI. É isso. >> [aplausos]
Transcrição original
[00:01] [music] >> My name is Bo. I’m going to be here presenting real-time voice agents with Frontier Intelligence. Effectively, going to be talking a little bit about how we at Xnor.ai architected our voice agent harness to get real-time voice with the Frontier level of intelligence that we need.
[00:32] Okay. So, before I start, I think I wanted to kind of draw some parallels about why we decided to go with cascaded voice agents and especially kind of comparing that to self-driving cars which I was working in before. So, to me, cascaded voice agents makes a lot of sense when you view it in lens of kind of breaking it down into perception which is for self-driving cars, it’s you know, the bounding boxes, the camera, the lidar.
[01:03] For voice, it’s going to be the transcription. Basically, effectively turning these like signals from the real world into elements of data that the language model or whatever brain you’re working on can process. Second one is the planning step which is pretty straightforward. This is where the language model will take in the outputs from the perception stage and produce the outputs that you want to produce out back and out into the real world.
[01:34] And finally, there’s the controls layer where on self-driving, you’d be taking the trajectory that the planner would output and kind of turn it into the real controls to kind of build like drive the car. Here, we’re turning the text into audio that we use to express our voice agent’s thoughts. And um yeah, so here I’m going to be like going to diving into each one of these elements and we’ve made a few kind of interesting tricks on each of these areas to
[02:08] improve the speed of our voice agents without sacrificing the intelligence. So, the first one is going to be uh the transcriber layer. So, we came up with this concept called like the streaming speculative transcriber where effectively we are layering a fast streaming transcriber like Flux on top of or kind of below a uh scribe V2 or a accurate batch transcription which kind of takes in more context. It’s a little bit slower, but it will give you more accurate detections.
[02:39] So, we’re going to walk through a scenario. So, in this in this case the agent just asked, you know, providing can you provide your name and date of birth and the user is going to say this and we’ll see how that plays out um timing-wise. So, first we’re going to get, you know, the short detection. Um we’ll get it from we’ll get it from the streaming layer. The accurate layer uh the corrective layer is not going to fire because it’s the same text. Um we’re going to get some more streaming text detections and in this case the corrective layer is actually
[03:11] canceled because we got new um new text. So, you know, more context, more audio is going to beat the old accurate one. And here’s where kind of the first correction comes in. So, because the scribe V2 layer understands, you know, the the context of the question, it’s able to understand that this is talking about name and this is a date of birth. Then a couple more detections, these are just punctuation, we don’t care. And so, in the end we kind of release this text over to the agent. And moving on um to the language model
[03:46] layer. So, here since we’re kind of using these slow but intelligent LLMs, we really want to reduce the number of round trips and the thing that causes us to do a lot of inferences is tool calling. So, one way to get rid of that is by having background agents do the tool calling for you and kind of um push the tools back into the context of the main agent so that it thinks it made the tool call, but um but it it it really didn’t.
[04:18] So, uh so, we remember from like detections from before. So, well, what happened is each one of these detections is going to trigger a um an early kind of generation of the agent and we but we won’t actually emit this out until we’re confirming that the user has finished speaking. So, in this case, the user says, “Sure.” The agent kind of knows that the user is about to say something else. Our background tool calling here, which is going to be helping us find figure out the name and the date of birth from the
[04:50] user detection, is not firing. So, nothing much there. Um the next instant detection comes in. It says that, you know, still not really a name. Um our agent kind of plays along and continues there. Now, kind of a more more context come comes back. The agent kind of feels like there should be a name. It’s going to ask to spell it out because it’s probably thinking there’s some transcription error here. Still no name or date of birth. And then finally, this you remember this is kind of our corrected um final
[05:22] instant detection from the transcriber from the Scribe V2. Um here, our eager kind of agent generation that was made without any tool calls is going to get canceled because the background agent finally is able to find the name and date of birth it’s looking for. So, it’s going to retrigger and now the the agent actually has the context it needs. Um and you see here, it’s kind of we’re doing it the tool call here is a little bit um um some intelligence there. We’re going to be like, you know, correcting mis-transcriptions of name, and doing
[05:54] some like phonetic matching here. Um and yeah, and then we’ll kind of once we’ve understood that this is the end of the user utterance, we’ll kind of emit it out. So, pretty standard. Okay, and then the next layer here is going to be text-to-speech. So, with text-to-speech the goal is to kind of take what the agent said, and the agent’s going to be emitting this in a streaming fashion. So, we’re going to need to um produce audio as quickly as possible. And ideally, what you can do is before the agent has even finished generating the full text you can have the audio
[06:30] play, so it’s kind of hiding the latency of finishing the generation. So, um I’m going to kind of play the streaming um the stream the streaming uh agent output now. So, starts with you. And yeah, actually before I uh further, there’s this new concept that we’re introducing here called the prefix cache. So, the prefix cache is going to be looking at the um agent stream, and seeing if we already have generated audio for that sequence of words um from like a prior generation, or maybe like the same
[07:04] generation um in this uh in this call as as well. So, um it sees the word you. Uh we for this prefix cache, we’re going to be, you know, we don’t want to like immediately hit on every single word. We’re going to be waiting for a little bit more words. Um so, after three words, the prefix cache gets our first hit. And um over here on the right, this is kind of our text-to-speech standard provider, you know, Cartesia is a text-to-speech engine with web socket support. So, we’re we’re piping the
[07:38] agent through the the cache, and also piping it through web socket. Um more tokens come in, more cache, more sending through web socket. Not much to say here. And okay, so now we get our first uh kind of first unique thing, which is we found the token that actually causes a cache miss. And it makes sense. If we’re kind of caching previous generations, um you said your name is is a pretty common thing, but once you we add in the
[08:08] name, suddenly we’re that’s that’s going to result in the cache miss. At this point, we’re actually going to yield out our cached audio. So, you said your name is is going to be um emitted as the rest of the streaming text is coming back. So, at this point, the user hears the agent and user doesn’t really know what’s going on. They just looks like really fast response times to them. Um and now the kind of remaining text flows through. And at this point, we’ve already emitted from the cache. The cache has done its job. Um the rest we can kind of throw
[08:42] into Cartesia. And here’s kind of the trick where Cartesia has seen the entire transcript up to this point. It to to Cartesia, like it doesn’t know about the existence of this prefix cache. It’s just going to generate this full sentence with, you know, standard natural prosody. But, what we do is when the generation comes back, since we’ve already played the audio here, we can actually suppress the audio from Cartesia here and just play out the remaining stuff. So,
[09:15] the user, there’s might be a tiny bit of a hiccup. You know, I’ll play some audio later and you’ll know that you probably won’t be able to notice. And effectively, we’re kind of taking this and or taking this part and just emitting it directly after this audio has finished playing. So, it looks seamless to the user. And yeah, so I guess at this point kind of this is a lot of technical details. I’ll I mean the best way is just kind of play a call and see
[09:47] see this in action. So here I recorded a call and let’s just hear what happens. >> This is Bo OBGYN Elise speaking. >> Hi, I think I might be pregnant and I want to schedule an ultrasound to confirm. >> That’s exciting news. Can you provide your name and date of birth? >> Sure, it’s Elise Trial. Date of birth 2303.
[10:21] >> Thank you. Are you a new patient with us? >> Yes. >> Welcome to Bo OBGYN. Can I text you a link to upload your insurance information? >> Sure. >> Okay, sent. Let me know when you’ve received it. I’ve received your insurance information. The earliest appointment I
[10:52] have is Thursday, July 2nd at 10:00 a.m. >> Actually, give me a second. Let me check my calendar. >> Sure, take your time. >> Um do you have something for next week? >> For next week, I can offer an ultrasound with Dr. Avery Stone at North Clinic on Tuesday, July 7th at 2:00 p.m. or 3:00 p.m. Do either of those work for you? >> Yeah, 2:00 p.m. works. >> Great. Your appointment has been booked.
[11:26] We look forward to seeing you then. >> Thanks. Bye-bye. >> All right. Yeah, that’s pretty much it. Um Yeah, you can kind of see our all this like uh streaming and you know, a lot of things are happening in the background and and you know, this is what really makes like voice agents interesting. And um there’s a lot of effort that can be done in the harness to really kind of get a um natural conversation, which is what
[11:57] we’re after. Uh okay. Yeah, so I guess briefly, you know, in the last part, I want to just talk a little bit about Elise. So I think Elise, you know, our headquarters are in New York and kind of we’re trying to expand our presence here in the Bay Area. Um we I think it’s maybe like a different style of company that I think people are like uh think of when they think about AI startups in San Francisco. Where we’re actually very focused on um just like helping people and helping
[12:30] people where they need it, like kind of the life’s most critical areas. We work on housing, health care and uh we’re doing really well and you know, here’s there’s a link here to um you kind of join our team and there’s going to we’re going to be uh posting a lot on Twitter, so you can follow us at EliseAI as well. Um yeah, that’s that’s it. >> [applause]