Skip to content

[Suggestion] Audio-to-structured-JSON extraction pipeline with Instructor and Deepgram (Python) #281

Description

@deepgram-robot

What to build

A Python example that chains Deepgram's pre-recorded STT with the Instructor library (structured LLM output) to extract typed, validated data from audio recordings. Given an audio file (e.g., a customer support call, a medical consultation, or a meeting), the pipeline transcribes it with Deepgram, then uses an LLM with Instructor to extract structured data into Pydantic models — e.g., extracting order details, appointment information, action items, or complaint summaries as typed JSON.

Why this matters

Developers building data extraction pipelines from audio need more than raw transcripts — they need structured, typed data they can feed into databases, CRMs, or downstream systems. The Instructor library (11K+ GitHub stars) is the standard tool for getting structured output from LLMs, but no example shows how to chain it with Deepgram. This pattern — audio → transcript → structured JSON — is one of the most requested workflows for contact center analytics, medical documentation, and meeting intelligence applications.

Suggested scope

  • Language: Python 3.11+
  • Deepgram APIs: Pre-recorded STT (Nova-3), optionally Audio Intelligence (sentiment, topics)
  • Dependencies: instructor, openai or anthropic (for LLM), pydantic
  • Complexity: Medium — pipeline orchestration + schema design
  • Define 2-3 example Pydantic schemas (e.g., CustomerComplaint, MeetingActionItems, AppointmentDetails)
  • Show how Audio Intelligence features complement LLM extraction
  • Include sample audio files or URLs for testing
  • Output validated, typed JSON

Acceptance criteria

  • Runnable with minimal setup (clone, add Deepgram + LLM API keys, run)
  • README explains the pattern clearly
  • Uses current Deepgram SDK version
  • Demonstrates at least 2 extraction schemas with different audio types
  • Produces validated Pydantic model output (not raw JSON)
  • Shows error handling for extraction failures (validation errors, low-confidence transcripts)

Raised by the DX intelligence system.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions