agents-js and webhooks, the default webhook doesn'...
# ask-ai
n
agents-js and webhooks, the default webhook doesn't seem to send a transcript, is there an official recommended approach to collect the transcript after a call, either through the agent or the room's webhooks?
t
Thanks for reaching out, Francisco. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about collecting a call transcript after a session when the default webhook doesn’t include it. Short answer: use the agent’s conversation events (specifically the
conversation_item_added
event) to capture the transcript. Room webhooks (like
room_finished
or
participant_left
) do not include conversation content. Why: LiveKit room webhooks are lifecycle/operational signals and do not carry full conversation text. The agent emits
conversation_item_added
each time a message (transcribed user speech or agent response) is added, so it provides a chronological stream of all transcript items. Recommended approach • Subscribe to
conversation_item_added
in your agents-js session and persist each item to your backend as it arrives. ◦ Example (agents-js):
Copy code
session.on('conversation_item_added', (item) => {
      // item.message.content and item.message.role contain the transcript and who spoke
      // store or forward item to your backend for the full transcript
    });
• If you need timestamps/precise timing, enable TTS-aligned transcriptions (
useTtsAlignedTranscript: true
) and use the transcription nodes/TimedString objects to record
start_time
and
end_time
. • If a call may end abruptly, explicitly close the agent session (
await session.aclose()
) to flush final items into the conversation history before you finalize storage. Additional options • Forward
conversation_item_added
events to your DB or file storage in real time so you can reconstruct the full transcript after the room finishes. • After
room_finished
, pull the stored transcript from your backend (not from the room webhook). If you’d like, I can: • Show a complete agents-js example that stores items to a simple backend endpoint. • Show how to enable and parse the TTS-aligned transcription objects. • Recommend a minimal schema for storing timestamps, role, and content. Which of those would help you next? Sources: Text and transcriptions | LiveKit Documentation | How to capture real-time agent transcriptions during conversations | Best practices for managing webhook event streams | LiveKit | Server-side | livekit/livekit_composite | DeepWiki | Understanding Transcript Timing in Voice Conversations