Recording Conversation Transcripts
Learn how to collect and save conversation transcripts between users and your bot
Overview
Recording transcripts of conversations between users and your bot is useful for debugging, analysis, and creating a record of interactions. Pipecat’s TranscriptProcessor
makes it easy to collect both user and bot messages as they occur.
How It Works
The TranscriptProcessor
collects transcripts by:
- Capturing what the user says (from
TranscriptionFrame
s) - Capturing what the bot says (from
TTSTextFrame
s) - Emitting events with transcript updates in real-time
- Allowing you to handle these events with custom logic
The TranscriptProcessor
provides two separate processors: one for user
speech and one for assistant speech. Both emit the same event type when new
transcript content is available.
Basic Implementation
Step 1: Create a Transcript Processor
First, initialize the transcript processor:
Step 2: Add to Your Pipeline
Place the processors in your pipeline at the appropriate positions:
Place transcript.user()
after the STT processor and transcript.assistant()
after transport.output()
to ensure accurate transcript collection.
Step 3: Handle Transcript Updates
Register an event handler to process transcript updates:
In addition to console logging, you can save transcripts to a database or file for later analysis.
Next Steps
Try the Transcript Example
Explore a complete working example that demonstrates how to collect and save conversation transcripts with Pipecat.
TranscriptProcessor Reference
Read the complete API reference documentation for advanced configuration options and event handlers.
Consider implementing transcript recording in your application for debugging during development and preserving important conversations in production. The transcript data can also be useful for analyzing conversation patterns and improving your bot’s responses over time.