$ show dograh-hq/dograh
Dograh is an open-source, self-hostable voice AI platform for building, deploying, and monitoring voice agents. It provides a visual workflow builder (node-based graph editor) for designing call flows, with deep integration across telephony providers (Twilio, Plivo, Vonage, Telnyx, Cloudonix, Vobiz, Asterisk ARI), STT/TTS/LLM models (OpenAI, Deepgram, Google, Azure, Cartesia, ElevenLabs, etc.), and real-time audio pipelines via the Pipecat library. The backend is a FastAPI monolith with PostgreSQL, Redis, and object storage, complemented by separate worker services (ARQ for background tasks) and a campaign orchestrator for bulk outbound calling. The system supports multi-tenancy, call recording, knowledge base/RAG, QA analysis, embeddable chat widgets, and an MCP server for AI-assisted workflow management. SDKs for Python and TypeScript enable programmatic workflow creation and outbound call triggering. While the core is a full-stack application, it includes evaluation frameworks for STT providers and post-call QA analysis, giving it a hybrid character but dominated by production application concerns.
The LLM identified 5 files worth highlighting for reuse:
A reusable Pipecat processor that defers cancellation frames to a registered async handler, eliminating race conditions between pipeline teardown and external state snapshots. Intercepts frames like CancelWorkerFrame and fatal ErrorFrame, calls the handler with a reason, and falls back to original cancellation after a timeout. Demonstrates empirical tuning (238 hangups measured) and a clean separation of concerns for pipeline lifecycle management.
Provides InMemoryAudioBuffer and InMemoryLogsBuffer classes that accumulate real-time data during a call (audio frames, debug logs) and expose them for post-call processing or upload. These are self-contained, thread-safe (asyncio), and can be extracted as a generic pattern for real-time data capture in any async pipeline.
Abstract BaseFileSystem class defining async methods for file creation, upload, signed URL generation, and deletion. Concrete implementations (Local, Minio, S3, Null) are provided. The pattern is clean, minimal, and easily reusable for any project needing cross-platform file storage with a pluggable backend.
A dataclass-based event protocol for campaign lifecycle events (batch, sync, retry, circuit breaker, etc.). Each event is a frozen dataclass with to_json/from_json methods for Redis pub/sub. The pattern is self-contained, type-safe, and can be extracted for any event-driven system requiring structured event definitions with serialization.
A pure function that transforms streaming real-time feedback events into a stable list of UI conversation items. Handles deduplication of bot text (concatenation), tool call lifecycle, metrics injection, and node transitions. The pattern is isolated, testable, and reusable for any real-time event stream that needs to be rendered in a chat UI.