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_textsaves 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file echoloop-0.1.0.tar.gz.
File metadata
- Download URL: echoloop-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
674015d2c46f3b76134f3e0775389273d3a5bc1d58c43c5056c9c89f29fecd0c
|
|
| MD5 |
3c025c6d3a71a51779850e5fae547a64
|
|
| BLAKE2b-256 |
f462715ea61af92d7be2e866c2aa55937183697f09682c7c95e3fc385d4deb49
|
File details
Details for the file echoloop-0.1.0-py3-none-any.whl.
File metadata
- Download URL: echoloop-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8476727b50e37d6b435ba8b1b8e127f6a3eb84d402d9593305fe817ef733d86a
|
|
| MD5 |
80a95926b16eae651d43ed8d3d1580d0
|
|
| BLAKE2b-256 |
06ee57f67b25d52fb2c44028c8e75a7ce1495373ec96166328ae9b554dda5ee7
|