ancient-lifeguard-58512
02/18/2026, 11:04 PMtall-airline-16756
02/18/2026, 11:04 PMtall-airline-16756
02/18/2026, 11:04 PMlk.transcription text stream topic on the frontend? (This is how frontend clients typically receive live transcriptions.)
• Are you using AgentSession? If yes, is text_output enabled for that session?
• Are you testing in the LiveKit Console/playground or in your own app? (The Console/playground does not display text-only agent responses unless you add a custom receiver.)
• Do your server or client logs show any errors related to STT, VAD, or transcription delivery? If so, please paste relevant log lines or error messages.
If you prefer, share the minimal relevant config (redact any secrets): STT provider config, AgentSession settings, and how your frontend subscribes to text streams. Once you share these, I’ll suggest the next steps to get transcripts appearing.
Sources: Text and transcriptions | LiveKit Documentation | How to build an agent with speech-to-text input and text-only output | Live...ancient-lifeguard-58512
02/18/2026, 11:14 PMtall-airline-16756
02/18/2026, 11:15 PMlk.transcription text stream topic (or using the SDK equivalent) so your frontend can receive transcription events?
• Are you using AgentSession for the agent flow? If yes, is text_output enabled on that session?
• Are you testing in the LiveKit Console/playground or in your own app? (Note: the console/playground does not show text-only agent responses unless you add a custom receiver.)
• Do you see any errors in server or client logs related to STT, VAD, or transcription delivery? If so, please paste the relevant log lines (redact secrets).
If you prefer, paste a minimal, redacted copy of:
• your STT provider config,
• the AgentSession config (or agent settings),
• and the client code snippet showing how you subscribe to text streams.
Once you share those details I’ll tell you the most likely fix and step-by-step actions to get transcripts working.ancient-lifeguard-58512
02/18/2026, 11:16 PMancient-lifeguard-58512
02/18/2026, 11:17 PMtall-airline-16756
02/18/2026, 11:22 PMAgentSession config when using Grok realtime on LiveKit Cloud. I’ll keep this short and show exactly where to define it and what to change so you can receive transcripts.
1) Where you define AgentSession
• You create AgentSession in your agent code (typically a Python file like agent.py) inside the RTC session handler (e.g., inside your @server.rtc_session() function). This is the place to pass in the LLM, STT plugin, and session options.
2) Why transcripts aren’t appearing with Grok realtime
• Grok is a realtime model and does not emit user speech transcriptions by default. Realtime models often do not provide interim transcription results and user transcripts can be delayed or absent unless you explicitly add transcription support.
3) How to enable transcripts — two options
• Option A — Add an STT plugin (recommended for live user transcripts)
a. Add an STT provider when creating the session (example using Deepgram):
from livekit.agents import AgentSession
from livekit.plugins import xai, deepgram
session = AgentSession(
llm=xai.realtime.RealtimeModel(), # Grok realtime
stt=deepgram.STT(), # enables user_input_transcribed events
)
1. Listen for user_input_transcribed events:
@session.on("user_input_transcribed")
async def on_transcript(event):
if event.is_final:
print("User said:", event.transcript)
• Option B — If you need the agent’s spoken text (agent output) as transcripts
a. Enable text_output in `AgentSession`:
session = AgentSession(
llm=xai.realtime.RealtimeModel(),
text_output=True,
)
1. Handle the agent output event to capture the text response.
4) Additional notes
• If you want speech timing for agent speech, implement a transcription_node in your agent to stream timing/chunk info.
• If you’re testing in the LiveKit Console/playground: text-only agent responses aren’t shown by default there — you’ll need a custom receiver in your client to display them.
5) Links you can use
• AgentSession reference: https://docs.livekit.io/agents/logic/sessions/
• Grok realtime plugin guide: https://docs.livekit.io/agents/models/realtime/plugins/xai/
• Text and transcriptions: https://docs.livekit.io/agents/multimodality/text/
If you’d like, paste a redacted snippet of your current agent.py (the part where you construct AgentSession) and I’ll point out the exact lines to change to enable transcripts.
Sources: Introducing the Grok Voice Agent API in partnership with xAI | xAI Grok Voice Agent API plugin | LiveKit Documentation | Realtime models overview | LiveKit Documentation | Repeater | LiveKit Documentation | LiveKit turn detector plugin | LiveKit Documentationancient-lifeguard-58512
02/18/2026, 11:36 PMtall-airline-16756
02/18/2026, 11:36 PMfrom livekit.plugins import deepgram
session = AgentSession(
llm=llm,
stt=deepgram.STT(), # enable user_input_transcribed events
)
1. Listen for transcripts:
@session.on("user_input_transcribed")
async def on_transcript(event):
if event.is_final:
text = event.transcript
if _is_meaningful_transcript(text):
<http://logger.info|logger.info>("User said: %s", text)
• If you want the agent’s text output (text of what Grok is saying)
a. Enable text_output on the session:
session = AgentSession(
llm=llm,
text_output=True, # receive agent responses as text events
)
1. Handle agent text events (example event name may vary by SDK):
@session.on("agent_text_response")
async def on_agent_text(resp):
text = resp.text
if _is_meaningful_transcript(text):
<http://logger.info|logger.info>("Agent said (text): %s", text)
If you tell me which option you need and whether you have an STT provider configured, I’ll give the exact drop-in code for your snippet and the precise event names to listen for.ancient-lifeguard-58512
02/18/2026, 11:37 PMtall-airline-16756
02/18/2026, 11:37 PMuser_input_transcribed.
• Enable text_output on the AgentSession to receive agent text responses.
• Wire handlers that capture and append both sides into a unified transcript (with timestamps and role).
Drop-in example (modify provider class to your STT plugin and add credentials to LiveKit Cloud):
1) Agent session setup (insert into your agent code where you create the session)
from datetime import datetime
from livekit.agents import AgentSession
# Replace with the STT plugin you will use. Example uses deepgram plugin name.
from livekit.plugins import deepgram
llm = await create_xai_realtime_llm(xai_module=xai, voice="ara")
logger.warning("✅ LLM FACTORY returned llm=%s", type(llm))
session = AgentSession(
llm=llm,
stt=deepgram.STT(), # enable user speech transcription events
text_output=True, # enable agent text output events
)
2) Helper to format and persist conversation lines
def _format_line(role: str, text: str) -> str:
ts = datetime.utcnow().isoformat() + "Z"
return f"{ts} [{role}]: {text}\n"
# Simple file append storage (replace with DB call if needed)
TRANSCRIPT_FILE = "/tmp/conversation_transcript.txt"
def _append_to_transcript(role: str, text: str):
line = _format_line(role, text)
with open(TRANSCRIPT_FILE, "a", encoding="utf-8") as f:
f.write(line)
<http://logger.info|logger.info>("Transcript appended: %s", line.strip())
3) Handle user speech transcripts
@session.on("user_input_transcribed")
async def on_user_transcribed(evt):
# evt.transcript, evt.is_final, evt.start_time, evt.end_time (if provided)
if not getattr(evt, "is_final", False):
return
text = getattr(evt, "transcript", "").strip()
if not _is_meaningful_transcript(text):
return
_append_to_transcript("caller", text)
4) Handle agent text output
@session.on("agent_text_response") # actual event name may be "agent_text" or similar
async def on_agent_text(evt):
# evt.text or evt.response_text depending on SDK; adjust as needed
text = getattr(evt, "text", None) or getattr(evt, "response_text", "")
text = (text or "").strip()
if not text:
return
_append_to_transcript("agent", text)
Notes on event names and fields
• The SDK/event names can vary slightly. Common events to listen for:
◦ user_input_transcribed — carries .transcript and .is_final.
◦ agent_text_response (or similar) — carries agent textual output in .text or .response_text.
• If an event name above is not firing in your environment, paste one example log of incoming session events and I’ll map the exact names to use.
Timestamps and speech timing
• STT plugins often supply start_time and end_time for user phrases; include them in the transcript if you need precise timing.
• Grok realtime may not provide interim user transcripts and agent transcript timing can be delayed; you’ll still capture the final textual content by using an STT plugin + text_output=True.
Required setup steps (checklist)
• Add STT provider credentials to your LiveKit Cloud project (project settings).
• Ensure your agent server has network access and correct environment variables for the STT plugin.
• Confirm the session is created with stt= and text_output=True.
• Make sure the client subscribes to text stream events, if you want client-side display in addition to server-side storage.
If you want, I can:
• Provide an adjusted snippet if your STT provider is not Deepgram (tell me which one).
• Change the storage example to a DB schema (Postgres/Mongo) or to upload to object storage.
• Inspect logs or a sample event payload if the handlers above don’t fire.
Which STT provider are you using, and do you want file or DB storage for the full transcript?ancient-lifeguard-58512
02/18/2026, 11:42 PMtall-airline-16756
02/18/2026, 11:43 PMtext_output on your AgentSession to capture agent text responses.
• Ensure the LiveKit Cloud project-level “Agent observability” (which captures traces, transcripts, audio) is enabled if you want LiveKit to collect/forward transcripts centrally.
• Confirm STT provider credentials are present in your LiveKit Cloud project settings.
Immediate checklist — run through these items
• Dashboard: Confirm “Agent observability” is Enabled in the project settings (your screenshot shows an “Agent observability” control — keep it Enabled). This allows capture of traces/transcripts at the project level.
• STT provider: Verify you still have STT credentials configured in the LiveKit Cloud project (Deepgram, AssemblyAI, Google, etc.). If those creds expired or were removed, transcripts will stop.
• AgentSession: Update your agent code to include both stt= and text_output=True when creating the session (see exact drop-in below).
• Event handlers: Add handlers for user_input_transcribed (user speech) and the agent text events to persist both sides of the conversation.
Drop-in edits for your snippet
• Replace the session creation with this (adjust deepgram.STT() to your provider if different):
from livekit.agents import AgentSession
from livekit.plugins import deepgram # replace with your STT plugin
llm = await create_xai_realtime_llm(xai_module=xai, voice="ara")
logger.warning("✅ LLM FACTORY returned llm=%s", type(llm))
session = AgentSession(
llm=llm,
stt=deepgram.STT(), # enables caller speech transcripts
text_output=True, # enables agent text responses
)
• Add handlers to capture and persist conversation lines:
from datetime import datetime
def _format_line(role: str, text: str) -> str:
ts = datetime.utcnow().isoformat() + "Z"
return f"{ts} [{role}]: {text}\n"
TRANSCRIPT_FILE = "/tmp/conversation_transcript.txt"
def _append_to_transcript(role: str, text: str):
line = _format_line(role, text)
with open(TRANSCRIPT_FILE, "a", encoding="utf-8") as f:
f.write(line)
<http://logger.info|logger.info>("Transcript appended: %s", line.strip())
@session.on("user_input_transcribed")
async def on_user_transcribed(evt):
if not getattr(evt, "is_final", False):
return
text = getattr(evt, "transcript", "").strip()
if not _is_meaningful_transcript(text):
return
_append_to_transcript("caller", text)
@session.on("agent_text_response") # if this event name doesn't match, I can map the exact server event name for you
async def on_agent_text(evt):
text = getattr(evt, "text", None) or getattr(evt, "response_text", "")
text = (text or "").strip()
if not text:
return
_append_to_transcript("agent", text)
Notes and common pitfalls
• Event names/fields can vary slightly by SDK version. If agent_text_response or field names don’t fire, paste a sample event payload and I’ll map it exactly.
• Realtime models (Grok) may not emit interim user transcriptions; you’ll get final transcripts via the STT plugin.
• If transcripts were working before and stopped:
◦ Check STT API key validity/permissions in the LiveKit Cloud project settings.
◦ Confirm “Agent observability” is still Enabled (your screenshot is the right place).
◦ Check agent server logs for STT or VAD errors; paste any error lines and I’ll interpret them.
• Storage: I showed a simple file example. I can convert that to DB or object storage if you prefer.
If you want, next steps I can take for you
• Provide the exact event names for your SDK version if you paste one raw event payload (server log).
• Give the specific deepgram/assemblyai config snippet if you tell me which provider you use.
• Convert file storage to Postgres/Mongo or show how to add timestamps/start/end times from STT events.
Which STT provider are you using, and can you confirm Agent observability is still Enabled in the project settings? If you prefer, paste one example log line from when the session starts and I’ll point to the exact event names to wire up.ancient-lifeguard-58512
02/18/2026, 11:49 PMtall-airline-16756
02/18/2026, 11:49 PMtext_output on the AgentSession.
◦ Caller (user) speech transcripts are NOT available unless you add a separate STT plugin (Deepgram, AssemblyAI, etc.).
• If transcripts worked before without an STT plugin, you were likely receiving agent text output (via text_output) and possibly project-level observability was forwarding events — not a built-in caller STT.
Most likely causes for transcripts stopping
• text_output was removed or not set on the AgentSession.
• Project-level Agent observability was toggled Off in the LiveKit Cloud dashboard.
• Event handler names changed or your code stopped subscribing to the correct agent text event.
• SDK version change altered event field names.
Minimal drop-in to restore agent+caller capture
• If you only want agent text (no STT), ensure text_output=True and capture the agent text event.
• If you want both sides, add an STT plugin to the session (one-time change) and capture user_input_transcribed.
Example (modify to match your environment):
1) Ensure project setting
• Dashboard → Data and privacy → Agent observability = Enabled (your screenshot shows this control).
2) AgentSession creation (Grok realtime LLM + agent text)
from livekit.agents import AgentSession
# Grok realtime LLM already created in your code as `llm`
llm = await create_xai_realtime_llm(xai_module=xai, voice="ara")
session = AgentSession(
llm=llm,
text_output=True, # required to receive agent text responses
)
3) Capture agent text (write to file / DB)
from datetime import datetime
TRANSCRIPT_FILE = "/tmp/conversation_transcript.txt"
def _append_to_transcript(role: str, text: str):
ts = datetime.utcnow().isoformat() + "Z"
with open(TRANSCRIPT_FILE, "a", encoding="utf-8") as f:
f.write(f"{ts} [{role}]: {text}\n")
@session.on("agent_text") # event name may be 'agent_text', 'agent_text_response', or similar
async def on_agent_text(evt):
text = getattr(evt, "text", None) or getattr(evt, "response_text", "")
if text and text.strip():
_append_to_transcript("agent", text.strip())
4) (Optional) Add caller speech transcripts
• If you want the caller’s spoken words too, add an STT plugin:
from livekit.plugins import deepgram # or your provider
session = AgentSession(
llm=llm,
stt=deepgram.STT(),
text_output=True,
)
• Then capture `user_input_transcribed`:
@session.on("user_input_transcribed")
async def on_user_transcribed(evt):
if not getattr(evt, "is_final", False):
return
text = getattr(evt, "transcript", "").strip()
if text:
_append_to_transcript("caller", text)
If it was “working before” without adding STT
• Double-check that text_output=True was present before and that Agent observability remained Enabled.
• If logs show agent text events being emitted under a different name, paste one raw event payload and I’ll map the exact event/field names for your SDK version.
What I need if this still doesn’t restore transcripts
• A short paste of your current AgentSession creation (the exact lines where you create session) and any session event handler code you have now.
• One example server log line showing an incoming agent event payload (redact secrets). That lets me tell you the exact event name/field to subscribe to.
Would you like me to produce a full ready-to-run agent.py example that:
• captures agent text,
• optionally includes Deepgram STT, and
• writes the full conversation to a Postgres or file storage?
Tell me which storage you prefer and paste your current AgentSession lines (if different from above) and I’ll give the exact drop-in file.ancient-lifeguard-58512
02/19/2026, 12:21 AMtall-airline-16756
02/19/2026, 12:21 AMAgentSession(...) code). You can redact keys; I just need the parameters used (for example whether text_output=True or stt= is present).
• The LiveKit Agents SDK version used in both projects (e.g., the package version from your requirements or pip freeze).
• Any differences in your agent startup or environment between the two projects (for example different environment variables, or different project settings like observability or recording).
What I’ll do with that info
• Compare the two configs and tell you exactly which setting or default is making transcripts appear automatically in the working project.
• Give you the minimal change to apply to the failing project (often either enabling Agent observability in the dashboard, adding a project-level STT key, or adding text_output=True to your AgentSession).
• If it’s an SDK version issue, I’ll point to the exact version and the change you can make (either upgrade/downgrade or set the explicit flag).
If you’d rather not copy configs, you can simply tell me:
• Is Agent observability Enabled in the working project? (yes/no)
• Is there a project-level STT provider configured? (yes/no and which one)
• Do you see text_output=True or stt= when creating AgentSession in the working project? (yes/no)
Send whichever is easiest and I’ll map out the one-line change to make the current project behave the same.ancient-lifeguard-58512
02/19/2026, 12:22 AMtext_output=True or stt= when creating AgentSession in the working project? (yes/no) --notall-airline-16756
02/19/2026, 12:23 AM