Skip to main content

echoloop

Deepgram speech tools for Claude's tool-use loop. Let Claude transcribe, speak, and read sentiment on demand.

echoloop registers three Deepgram capabilities — speech-to-text (with summarization), text-to-speech, and audio sentiment — as Anthropic tool-use tools. You hand Claude a message; Claude decides, mid-conversation, which Deepgram function to call, the call runs, and the result flows back into the conversation until Claude produces a final answer. You own the loop, inside your own Python app.

How this differs from deepgram-mcp

Deepgram's official deepgram-mcp is an MCP server that gives AI editors (Claude Code, Cursor, Windsurf) access to Deepgram tools. echoloop is the other use case: Deepgram as Anthropic tool-use inside your own program. It is not an MCP server and not for editor integration.

Install

Once published to PyPI:

pip install echoloop

From a local clone (development):

git clone https://github.com/rahat-axes/echoloop-claude-to-deepgram
cd echoloop
pip install -e .          # add ".[dev]" for pytest/build/twine

Requires Python 3.10+.

Configuration

Two environment variables are required (see .env.example):

DEEPGRAM_API_KEY=your-deepgram-key
ANTHROPIC_API_KEY=your-anthropic-key

Put them in a local .env (git-ignored) or export them in your shell.

The three tools

Each is a plain function you can call directly, and each is also registered with Claude via TOOLS. The audio source may be either a public https URL or a local file path — the tool detects which.

Tool Signature Returns
transcribe_audio transcribe_audio(source: str) {"transcript": str, "summary": str}
analyze_sentiment analyze_sentiment(source: str) {"sentiment": str, "score": float}
speak_text speak_text(text: str, voice="aura-2-thalia-en", out_path="./output.mp3") {"audio_path": str}

Note: speak_text saves the synthesized audio to a file and returns its path — it never plays audio. Playback is the caller's choice (this keeps it headless-friendly for servers and CI).

Quickstart

from echoloop import run_agent

# Claude decides which tool(s) to call and summarizes the result.
answer = run_agent(
    "Here's a recording: https://dpgr.am/spacewalk.wav. "
    "Summarize it and tell me the overall sentiment."
)
print(answer)

You can also call the tools directly, without Claude:

from echoloop import transcribe_audio, analyze_sentiment, speak_text

print(transcribe_audio("samples/interview.wav"))           # {"transcript": ..., "summary": ...}
print(analyze_sentiment("https://dpgr.am/spacewalk.wav"))  # {"sentiment": "positive", "score": 0.64}
print(speak_text("Hello from echoloop."))                  # writes ./output.mp3

Demo

demo.py runs one prompt that forces multiple tools and prints each step:

python demo.py

Abbreviated output:

[tool] transcribe_audio
       args:   {"source": "https://dpgr.am/spacewalk.wav"}
       result: {"transcript": "...", "summary": "The speaker reflects on the first all-female spacewalk..."}

[tool] analyze_sentiment
       args:   {"source": "https://dpgr.am/spacewalk.wav"}
       result: {"sentiment": "positive", "score": 0.6363218354015816}

[tool] speak_text
       args:   {"text": "The speaker discusses the historic all-female spacewalk..."}
       result: {"audio_path": "./output.mp3"}

FINAL ANSWER:
Here's a full breakdown: ... (summary + positive sentiment + spoken summary saved to ./output.mp3)

Public API

from echoloop import (
    run_agent,          # the Claude tool-use loop
    TOOLS,              # Anthropic tool definitions for the three tools
    transcribe_audio,
    analyze_sentiment,
    speak_text,
    DeepgramToolError,  # raised on Deepgram failures
    AgentError,         # raised on agent-loop setup failures
)

Development

pip install -e ".[dev]"
pytest        # fully offline — all network calls are mocked

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

echoloop-0.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

echoloop-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file echoloop-0.1.1.tar.gz.

File metadata

  • Download URL: echoloop-0.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for echoloop-0.1.1.tar.gz
Algorithm Hash digest
SHA256 52d00fc13699ddcfd6f5d8820050f6ba38d8cb5faedc5a6cfc59685895bc1e21
MD5 cdc94cb27175605682afce4356d19858
BLAKE2b-256 7dd045d7f38e7d5efe34cee92b1ee49f784fb13b1425ebda4ca11260329809a5

See more details on using hashes here.

File details

Details for the file echoloop-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: echoloop-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for echoloop-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b65094c82058caa91c2c60b443d792668f8ecafc02131644e72662d969830c3c
MD5 77b52e5c23e319547c127b2c00efbe76
BLAKE2b-256 8c870cc7f29ea1918d7c7cb0d447a40a163b416f0be3e2c70c24125884b02d18

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page