"The Great Stories" system has two main processing flows: Asynchronous pipeline (Kafka + workers): For full job processing with webhooks, polling, and API-key quotas. The worker processes jobs, segments text, generates images and audio, and stores assets in S3. Synchronous agents (gRPC + MCP): A separate agents service exposes segmentation, audio, and image generation over gRPC and MCP (Model Context Protocol) with API key auth. External systems can call these directly: gRPC provides all agents (segmentation, audio narration + TTS, image prompt + generation) with protobuf contracts. MCP (JSON-RPC 2.0 over HTTP) exposes segment_text, generate_image_prompt, and generate_image as tools with schema discovery. Large assets (audio, images) are automatically uploaded to S3 with user-scoped paths (agents/<user_uid>/audio/...) and returned as URLs to avoid message size limits.
"The Great Stories" system has two main processing flows: Asynchronous pipeline (Kafka + workers): For full job processing with webhooks, polling, and API-key quotas. The worker processes jobs, segments text, generates images and audio, and stores assets in S3. Synchronous agents (gRPC + MCP): A separate agents service exposes segmentation, audio, and image generation over gRPC and MCP (Model Context Protocol) with API key auth. External systems can call these directly: gRPC provides all agents (segmentation, audio narration + TTS, image prompt + generation) with protobuf contracts.
MCP (JSON-RPC 2.0 over HTTP) exposes segmenttext, generateimageprompt, and generateimage as tools with schema discovery. Large assets (audio, images) are automatically uploaded to S3 with user-scoped paths (agents/<user_uid>/audio/...) and returned as URLs to avoid message size limits.
POST request to the /v1/jobs endpoint. The API Service acts as the gatekeeper.
2. Asynchronous Processing The heavy lifting happens in the Processing Layer. The Worker Service consumes the new message from the queue.
POST Callback to the external User Webhook, proactively notifying the client that the work is done.