agents icon indicating copy to clipboard operation
agents copied to clipboard

Post-Call CRM & Analytics Telemetry Collector for livekit/agents

Open abhishektangudu opened this issue 4 months ago • 6 comments

Feature Type

Nice to have

Feature Description

When building enterprise GTM voice agents (e.g., inbound sales discovery, lead qualification, or support bots), syncing post-call session data to systems of record (Salesforce, BigQuery) is a core requirement.

While LiveKit offers OpenTelemetry (for OTLP trace spans to SigNoz/Langfuse) and Server Webhooks (for room lifecycle events), there is currently a gap for developers who need a single, structured JSON document containing full transcripts + @function_tool execution records to send to business webhooks. Server webhooks do not contain transcripts or tool logs, and OpenTelemetry spans are split across micro-events designed for APM tools rather than CRM ingestion.

Describe the solution you'd like: Add a lightweight, opt-in PostCallTelemetryCollector and standardized PostCallReport schema to livekit.agents.beta.gtm_telemetry.

Placement note: The module lives in beta/ (the repo's established opt-in staging area for features like EndCallTool and workflows) rather than the top-level telemetry/ package, which is reserved for OTel/Cloud plumbing with private exports. This avoids expanding the stable public API surface before the feature graduates.

Key capabilities:

Automatically records transcript turns (via conversation_item_added), @function_tool executions (via tool_execution_updated + function_tools_executed — with self-timed latency, arguments, results, and errors), and session metrics (via metrics_collected). Generates a clean, serializable PostCallReport JSON payload with float-epoch timestamps (matching the repo-wide created_at: float = Field(default_factory=time.time) convention — avoids the deprecated datetime.utcnow() and stays deterministic under the virtual-time test harness). Built-in resilient webhook dispatcher with HMAC-SHA256 signing (X-LiveKit-Signature header) and exponential backoff (max 3 attempts, 5xx + network retries, no retry on 4xx). Standardized adapters for HubSpot Engagements API & Salesforce Activity Tasks (pure payload builders — no network or CRM SDK dependencies). How this complements existing LiveKit features:

Does not replace OpenTelemetry (OTel continues to trace micro-spans). Does not replace Server Webhooks (Server webhooks continue handling room lifecycle). Provides self-hosted and cloud users with an application-level GTM summary payload. Works with or without a JobContext, on both the pipeline (STT→LLM→TTS) and real-time paths. I have implemented a fully tested solution and am ready to submit a PR if this aligns with the framework roadmap!

Workarounds / Alternatives

No response

Additional Context

No response

abhishektangudu avatar Aug 02 '26 05:08 abhishektangudu

@abhishektangudu am working on this issue

samanyugoyal2010 avatar Aug 02 '26 09:08 samanyugoyal2010

@samanyugoyal2010 I already worked on this. But to merge it, I first need to create the issue. I created it as part of that.

abhishektangudu avatar Aug 05 '26 19:08 abhishektangudu

@samanyugoyal2010 I already worked on this. But to merge it, I first need to create the issue. I created it as part of that.

@abhishektangudu what do you want me to do with my PR because it is already made and done

samanyugoyal2010 avatar Aug 05 '26 21:08 samanyugoyal2010

Here is my https://github.com/livekit/agents/pull/6716#pullrequestreview-4869183202 can you help me fix review comments that are raised. Also I am more than happy to collaborate with you.

abhishektangudu avatar Aug 05 '26 22:08 abhishektangudu

Sounds good my PR #6664 already addresses all the issues if you wanted to take a look at it

samanyugoyal2010 avatar Aug 05 '26 22:08 samanyugoyal2010

The one you linked is an issue. It's not a PR.

abhishektangudu avatar Aug 06 '26 03:08 abhishektangudu