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-claude-to-deepgram
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

Metadata

Release files for echoloop 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for echoloop 0.1.2
File Size Uploaded Provenance Actions
echoloop-0.1.2.tar.gz 7.9 kB Without provenance Details for echoloop-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for echoloop 0.1.2
File Interpreter ABI Platform Actions
echoloop-0.1.2-py3-none-any.whl Python 3 none any Details for echoloop-0.1.2-py3-none-any.whl

Total release size: 17.7 kB

Release files / echoloop-0.1.2.tar.gz

Download URL echoloop-0.1.2.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7cb7c6410054fc2292ec9626c4d4e0f40d45cdf2d6c4ba0f835ca671e86b2eb3
BLAKE2b-256 checksum
How to use checksums
98fdab7255428eaf3b3279510f8e1edc49dff398dd42180630f71f2d87a210aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / echoloop-0.1.2-py3-none-any.whl

Download URL echoloop-0.1.2-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1da9115fd664a65b6cbb40ad5f128e30d7bdc5f0fb9c5649581e48dffb5d2fe5
BLAKE2b-256 checksum
How to use checksums
09165530086541c5c686cf12712ae117932600a38fc8ef5b8b0c65ddf1b0f2eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for echoloop 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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