Mediagram
A conversational AI assistant powered by Claude that helps with media processing tasks. Works via Telegram or CLI.
Mediagram uses a plugin architecture to extend functionality. The core package provides the agent system and built-in tools, while additional tools can be installed as separate plugins.
Installation
Using pip
pip install mediagram
Using uv (recommended for development)
git clone https://github.com/yourusername/mediagram.git
cd mediagram
uv sync
Configuration
Configure environment variables:
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
# For Telegram: add TELEGRAM_BOT_TOKEN
Installing Plugins
Mediagram has a plugin system for additional tools. Install plugins as needed:
# From PyPI (when published)
mediagram plugin install mediagram-http
mediagram plugin install mediagram-ffmpeg
mediagram plugin install mediagram-yt-dlp
# From GitHub
mediagram plugin install git+https://github.com/user/mediagram-plugin.git
# Development mode
mediagram plugin install -e /path/to/plugin
Usage
Run Mediagram
# Interactive CLI mode
mediagram run cli
# Telegram bot
mediagram run telegram
Run Tools Directly
# List available tools
mediagram tool --help
# Run a specific tool
mediagram tool listdir --path .
mediagram tool grep --pattern "TODO" --path .
Manage Plugins
# List installed plugins
mediagram plugin plugins
# Install a plugin
mediagram plugin install mediagram-http
# Uninstall a plugin
mediagram plugin uninstall mediagram-http -y
Commands
Both drivers support the same commands:
/help- Show all available commands/clear- Clear chat history and start a new conversation/model [name]- Change model or show current model- Available models:
haiku(Claude Haiku 4.5),sonnet(Claude Sonnet 4.5)
- Available models:
/tools- List all available tools with their signatures and descriptions/quitor/exit- Exit (CLI only)
Plugin Management
Mediagram provides commands to manage plugins (similar to llm CLI):
List Installed Plugins
# List plugin packages (excludes built-in tools)
mediagram plugin plugins
# List all plugins including built-in
mediagram plugin plugins --all
# Filter by hook
mediagram plugin plugins --hook register_tools
Install Plugins
# From PyPI
mediagram plugin install mediagram-http
# From GitHub
mediagram plugin install git+https://github.com/user/mediagram-plugin.git
# From local directory
mediagram plugin install /path/to/plugin
# Editable/development mode
mediagram plugin install -e /path/to/plugin
# Multiple packages
mediagram plugin install mediagram-http mediagram-ffmpeg mediagram-llm
Uninstall Plugins
# With confirmation prompt
mediagram plugin uninstall mediagram-http
# Skip confirmation
mediagram plugin uninstall mediagram-http -y
# Multiple packages
mediagram plugin uninstall mediagram-http mediagram-ffmpeg -y
Emergency Plugin Disable
If a broken plugin prevents mediagram from running:
# Disable all plugins temporarily
MEDIAGRAM_LOAD_PLUGINS='' mediagram plugin uninstall mediagram-broken-plugin
Plugin Architecture
Mediagram uses a plugin system based on Pluggy. Tools are registered via the mediagram entry point group in pyproject.toml.
Plugin Packages
Plugin packages are distributed separately from the core. Each plugin is self-contained and can be:
- Published to its own repository
- Distributed via PyPI
- Installed from any source (PyPI, GitHub, local path)
Available plugins:
- mediagram-yt-dlp - YouTube download tool
- mediagram-ffmpeg - FFmpeg media processing
- mediagram-llm - LLM file processing
- mediagram-http - HTTP fetch tool
- mediagram-assemblyai - Audio transcription
Plugin requirements:
- Depend on
mediagram>=0.1.0 - Define entry point:
[project.entry-points.mediagram]
Creating a Plugin
- Create a package with this structure:
# my_plugin/__init__.py
from mediagram import hookimpl
from mediagram.agent.tools import tool
from mediagram.agent.callbacks import SuccessMessage
@tool
async def my_tool(arg: str):
"""My custom tool."""
# Tool logic here
yield SuccessMessage(f"Processed: {arg}")
@hookimpl
def register_tools(register):
"""Register tools with mediagram."""
register(my_tool)
- Add entry point in
pyproject.toml:
[project.entry-points.mediagram]
my_plugin = "my_plugin"
- Install and the tool will be available automatically.
Features
- Persistent conversation history per user
- Async message handling using llm's async API
- Support for multiple Claude models
- Dynamic model switching
- Two interaction modes: Telegram and CLI
- Markdown rendering in Telegram (with fallback to plain text)
- Context-aware system prompts with user information and current time
- Plugin-based tool system with progress reporting
Metadata
Release files for mediagram 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mediagram-0.1.0.tar.gz | 31.8 kB | Without provenance | Details for mediagram-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mediagram-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mediagram-0.1.0-py3-none-any.whl |
Total release size: 78.7 kB
Release files / mediagram-0.1.0.tar.gz
| Download URL | mediagram-0.1.0.tar.gz |
|---|---|
| Size | 31.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9abd75abdcb1ab1f39071833c18b7ed210c4bfb5a585f5bd3477d9f896ca5493
|
|
BLAKE2b-256 checksum How to use checksums |
38c25f49b5dcb573b5c4616d3589ffb03fbb839f195078bc008cd22280b1faa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Release files / mediagram-0.1.0-py3-none-any.whl
| Download URL | mediagram-0.1.0-py3-none-any.whl |
|---|---|
| Size | 46.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93cba54bace1f659467056c94cf801e7530315bcd3b19559eb250cca7f5a43ae
|
|
BLAKE2b-256 checksum How to use checksums |
4a4734131723981185e75048cf030667d844a497c243d0df5516becd9bedd1c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Security for mediagram 0.1.0
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.