The infrastructure that agents consume — not another wrapper around someone else's API.
A self-hosted engine that turns a supported source — a URL, a file, plain text — into media, subtitles, transcripts, summaries, translations, chapters, thumbnails, metadata, Markdown and PDF. The public request describes what you want to obtain, never the technical operations to perform.
The backend analyses the source, resolves the capabilities actually available, builds a deterministic execution plan and runs it as an observable job — states, ordered events, progress, logs, provenance, cancellation, resumption — then delivers properly named files into a media library. yt-dlp, ffmpeg, Whisper, the LLMs and the PDF renderer stay replaceable implementation details behind dedicated boundaries.
AI capabilities are optional and local by default: summaries, translations and derived chapters run through a local Ollama, or an explicitly configured Anthropic/OpenAI key; transcription through a local Whisper runner. A missing runner does not make the service unhealthy — the capability is simply declared unavailable, and an impossible request is refused before the job starts.
The interesting problems were architectural: keeping one core usable by a human, by another developer and by an agent, without letting three implementations diverge.
One core, eight surfaces
- Backend engine
- Domain model and application architecture — intent, execution plan, job and artifact stay distinct objects. SQLite as the source of truth, embedded worker.
- REST API + OpenAPI
- API design, and one public contract shared by every other surface.
- content-sdk — typed Python SDK
- Designing for other developers: typing, ergonomics, packaging, versioning. Sync and async, published on PyPI.
- content-cli
- The operator surface: terminal, scripts, cron, request files. Distribution and release engineering.
- content-mcp — MCP server
- Intent-level tools for agents (analyse, generate, track, cancel, fetch artifacts) with no shell access and no backend internals exposed. Running in production on the homelab.
- Chromium extension
- A user surface inside a constrained execution context — a JavaScript client of the same API.
- Three web interfaces
- Content Studio for general workflows, HomeTube for the YouTube path, Content Console for health, configuration, storage, jobs, events and logs — an operations console, not a demo UI.
- Multi-container Docker stack
- Single-host deployment a third party can actually install: one compose file, updates by pull. amd64 and arm64, no Redis, Celery or Kubernetes required.