How we can achive a posttranscription in livekit
# ask-ai
m
How we can achive a posttranscription in livekit
t
Thanks for reaching out, Technology. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
m
How we can achive a posttranscription in livekit
t
Thanks — you're asking how to achieve post‑transcription in LiveKit. Do you mean one of the following? • Exporting the full transcript after a session ends (download/save JSON or session report). • Running post‑processing on transcripts (redaction, punctuation, summarization) after the session. • Accessing stored transcripts for compliance, analytics, or debugging via the Agent Insights/dashboard. Also tell me: 1. Are you using LiveKit Cloud or a self‑hosted LiveKit agent? 2. Do you already have real‑time transcription enabled during the session? 3. What do you want to do with the post transcripts (export, transform, store, analyze)? Tell me which option matches your goal (or describe your exact use case) and I’ll give the exact steps or sample code. Sources: Observability data hooks | LiveKit docs | Text and transcriptions | LiveKit docs | Pipeline nodes and hooks | LiveKit docs | Agent insights in LiveKit Cloud | LiveKit docs | Streamline Troubleshooting with Agent Observability
Thanks — I’m following up on your question about achieving post‑transcription in LiveKit. Which of these matches what you need? • Export full transcript after a session ends (save JSON or generate a session report). • Run post‑processing on transcripts after the session (redact, punctuate, summarize). • Retrieve stored transcripts from Agent Insights/dashboard for compliance or analytics. And please tell me: 1. Are you using LiveKit Cloud or a self‑hosted LiveKit agent? 2. Is real‑time transcription already enabled during sessions? 3. Where do you want to store/process the post transcripts (S3, database, local storage, external NLP service)? Answer those and I’ll provide exact steps or sample code for your setup.
m
We are using LiveKit cloud ship plan.
t
Thanks — since you’re on LiveKit Cloud (Ship), here’s how you can achieve post‑transcription. Which of these do you want first: export/save transcripts, run post‑processing (redact/summarize), or retrieve via the Agent Insights dashboard? Quick options you can use on LiveKit Cloud Ship: • Export full transcript/session report after session end a. Use the session report API or call
ctx.make_session_report()
in your agent’s
on_session_end
callback to produce a structured report with conversation history, timestamps, events, and recording metadata. b. Save that report (JSON) to your storage (S3, DB, or local) from the shutdown callback. • Post‑process transcripts after session ◦ Capture the session transcript (from
session.history
or the session report), then run your post‑processing pipeline (redaction, punctuation, summarization, NLP) as a separate job or serverless function after the session ends. • Access transcripts via Agent Insights ◦ Use the Agent Insights dashboard to view turn‑by‑turn transcripts, recordings, traces, and metrics. This data is retained for 30 days by default; export from the dashboard or pull reports programmatically if needed. Next steps I need from you to give exact sample code and API calls: 1. Do you want a code example to save the session report automatically to S3 (or another target)? If so, which target? 2. Do you need a sample post‑processing pipeline (redaction or summarization)? 3. Do you want instructions for downloading data from Agent Insights or automating exports? Tell me which option and target you prefer and I’ll provide the exact steps/code.
m
does this work for OpenAI Realtime as well
t
Thanks — regarding whether post‑transcription on LiveKit Cloud Ship works with OpenAI Realtime: Short answer: Not the same way by default. OpenAI Realtime processes audio internally and does not emit separate user STT events, so you won’t get the usual user transcription objects to post‑process or export unless you add an STT step. What you can do (options): • Add a separate STT plugin (e.g., Whisper or another STT) alongside OpenAI Realtime. That produces user transcription events you can save, post‑process, or include in a session report. • Configure the Realtime model in text mode (
modalities=["text"]
) and pair it with an STT plugin so user speech is transcribed separately and is available for post‑processing. • You can still use
transcription_node
to modify agent-generated text (agent output) even with OpenAI Realtime. • Use
ctx.make_session_report()
or
session.history
in
on_session_end
to export/save transcripts once you have STT output (or to capture agent outputs). If you want, I can: 1. Provide a sample AgentSession config showing OpenAI Realtime + Whisper STT, or 2. Show code to auto-save
ctx.make_session_report()
to S3 on session end. Which would you like? Sources: Realtime model plugins | LiveKit Docs | Text and transcriptions | LiveKit docs | Pipeline nodes and hooks | LiveKit docs | Azure OpenAI Realtime API and LiveKit | LiveKit Docs
m
let say we use chatgpt 4.0 transcribe as separate plugin
t
Great — since you’ll run ChatGPT‑4.0 (or another STT-capable model) as a separate transcription plugin alongside OpenAI Realtime, here’s a concise plan and sample code to get post‑transcription working on LiveKit Cloud Ship. Which part do you want first: the AgentSession config (Realtime + STT), the post‑session save (auto save session report/JSON to S3), or a post‑processing example (redact/summarize)? Below are all three so you can pick. 1) AgentSession config (Realtime + separate STT) • Run the Realtime model in text mode and add ChatGPT‑4.0 (or your chosen STT) as the STT plugin so user speech is transcribed separately and available as
UserInputTranscribedEvent
.
Copy code
session = AgentSession(
    llm=openai.realtime.RealtimeModel(modalities=["text"]),  # Realtime model handles conversation
    stt="openai/gpt-4o-transcribe-1",                        # example transcription plugin
    tts="cartesia/sonic-3"                                  # optional
)
• With this, user transcripts arrive as separate events and can be processed, emitted to
session.history
, and included in session reports. 2) Capture and export post‑transcription (auto save session report to S3) • Use
on_session_end
/ shutdown callback to call
ctx.make_session_report()
or save
session.history
to JSON, then upload to S3.
Copy code
import json
import boto3

s3 = boto3.client("s3")

async def on_session_end(ctx: JobContext) -> None:
    report = ctx.make_session_report()
    data = json.dumps(report, indent=2)
    key = f"transcripts/session_report_{ctx.room.name}_{ctx.job.id}.json"
    s3.put_object(Bucket="your-bucket-name", Key=key, Body=data, ContentType="application/json")
• This stores a structured session report that includes turn-by-turn transcripts, timestamps, events, and recording metadata. 3) Post‑processing pipeline (example: redact then summarize) • After saving or in a separate serverless job, run post‑processing:
Copy code
def redact(text):
    # simple example: remove SSNs/emails (use regex as needed)
    return re.sub(r"\b\d{3}-\d{2}-\d{4}\b", "[REDACTED]", text)

def summarize(transcript_text):
    # call LLM or your summarizer
    return call_summary_model(transcript_text)

# Usage
raw = report["conversation_history"]  # adapt to actual report structure
clean = [redact(turn["text"]) for turn in raw]
summary = summarize("\n".join(clean))
• Save redacted transcripts and summaries back to S3 or DB. Notes and tips • Keep Realtime
modalities=["text"]
so the Realtime model does not swallow user audio transcripts. • Use
RoomOutputOptions(sync_transcription=False)
if you want transcription forwarded immediately rather than synchronized to TTS timing. • Agent Insights still captures transcripts and recordings for 30 days; use reports for long‑term storage. • If you want code tailored to your runtime (Node, Python) or an S3 example with credentials/permissions, tell me which and I’ll provide it. Which of the three (config, S3 export, or post‑processing) would you like a detailed sample for first?
m
I dont need code. I want to know how much will it cost me per minute and will I achieve the functionality to show transcription realtime and post session?
t
Thanks — short answer: Cost per minute (estimated) • LiveKit Cloud Ship agent time: $0.01 / minute. • OpenAI (GPT‑4o transcribe) STT plugin: ~$0.10 / minute (billed by OpenAI to your account). • Combined estimate: about $0.11 / minute (plus any extra storage/recording overages). Functionality • Real‑time transcription display: Yes — you can show interim and final transcription updates to the frontend. • Post‑session transcription: Yes — you can export session reports or session.history (JSON), save to S3/DB, and run post‑processing (redact, summarize) after the session. • Note: When using OpenAI Realtime as the LLM, ensure you run the STT as a separate plugin or run the Realtime model in text mode so user speech is emitted as transcriptions. If you want, I can confirm exact OpenAI STT model pricing you plan to use or break down any storage/recording overage costs. Which would you like? Sources: Deploy and scale agents on LiveKit Cloud | Azure OpenAI STT plugin guide | LiveKit Docs | Text and transcriptions | LiveKit docs | LiveKit Pricing
m
But in OpenAI API it shows $0.006/min
t
Thanks — good catch. If OpenAI shows $0.006/min for the STT model you plan to use, here’s the corrected cost and notes. Cost per minute (recalculated) • LiveKit Cloud Ship agent time: $0.01 / minute. • OpenAI STT (as you see): $0.006 / minute. • Combined estimate: $0.016 / minute (plus any storage/recording or data overage charges). Functionality — yes • Real‑time transcription display: supported (interim + final updates). • Post‑session transcription: supported (export session report / session.history, save to S3/DB, run post‑processing). Additional notes • OpenAI STT charges are billed by OpenAI to your account; LiveKit charges separately for agent runtime and any recording/storage overages. • If you record audio or keep observability beyond included limits, storage/recording overages may apply. • If you want, I can recalculate total expected monthly cost given your estimated minutes, recordings, and storage needs. Would you like that?
m
So what I want to achive in that interview starts between Human and AI or Human vs Human behind the scene with OpenAI Realtime and Open AI 4o transcribe for stt and once interview closes i just take the recording transcription and store them into my cloud s3
t
Sounds good — your plan is valid and achievable on LiveKit Cloud Ship. Below is a concise, non‑code summary of how it will work, cost recap, and key considerations. What you can do (workflow) • Run OpenAI Realtime as the conversational LLM (handles the dialogue and responses). • Add OpenAI GPT‑4o‑transcribe (or another STT plugin) alongside Realtime so user audio is transcribed separately into user transcription events. • Stream interim and final transcription events to the frontend so participants see live captions. • Record the session audio and/or capture the session transcript (use
session.history
or generate a
SessionReport
) when the interview ends. • Upload the final transcript/recording to your S3 bucket for long‑term storage and any post‑processing (redaction, summarization). Cost recap (per minute) • LiveKit agent runtime: $0.01 / minute. • OpenAI STT (your reported rate): $0.006 / minute. • Combined estimate: ~$0.016 / minute (plus storage/recording overages and any extra LiveKit/Cloud costs). Key considerations • Make Realtime operate in text mode or ensure the STT plugin is configured so user speech is emitted as separate transcription events (otherwise Realtime may not expose user transcripts). • Interim (live) captions rely on the STT plugin producing interim updates; final transcripts come from the STT finalization or the saved session report. • Use
ctx.make_session_report()
or session.history at session end to capture full turn‑by‑turn transcripts and metadata for upload to S3. • Recording/storage: store audio and transcripts to S3; expect additional charges if you exceed Ship plan recording/storage allowances. • Privacy/compliance: redact sensitive data before long‑term storage if required. If you want, I can: • Confirm exactly which STT model name/pricing you’ll be billed for, or • Estimate monthly cost given your expected minutes and storage. Which of those would help next?
m
So what will be the cost for 100 interviews of 30 minutes between two
t
Calculation for 100 interviews × 30 minutes: • Total minutes = 100 × 30 = 3,000 minutes Per-minute rates: • LiveKit agent runtime: $0.01 / min • OpenAI STT: $0.006 / min • Combined: $0.016 / min Costs: • LiveKit: 3,000 × $0.01 = $30.00 • OpenAI STT: 3,000 × $0.006 = $18.00 • Combined total = $48.00 Potential additional costs (not included above): • Audio recording storage (S3): depends on audio size (GB) and your S3 rates. • LiveKit recording/storage overages if you exceed Ship plan allowances. • Any other API usage (LLM inference beyond STT) billed separately. Would you like an estimate that includes S3 storage based on an expected audio bitrate or file size per interview?