JiwaAI
Blog
โ†All posts
ai
architecture
resilience
influencer-marketing
content-generation
prompt-engineering
engineering

Building a Calibrated AI Content Pipeline โ€” Five Improvements That Matter

Jiwa AI Teamยท

The Problem with a Naive Pipeline

When you build an AI content pipeline quickly, you make practical tradeoffs. Synchronous calls are simpler than async jobs. A single capable influencer can fill a content calendar. A fast, cheap model can judge quality. These decisions ship the product โ€” and then, as usage grows, each one becomes a liability.

Over the past week, we audited Jiwa AI's pipeline end-to-end and found five places where the initial tradeoffs were costing us. Here is what we changed and why it matters.

Async Reel Generation

Generating a short-form video reel is a compute-intensive task. In the original pipeline, that work happened inside a single HTTP request โ€” which meant users sat staring at a spinner for up to three minutes before anything happened. In practice, that request would frequently time out in production environments with aggressive gateway limits.

We moved reel generation to an async Cloud Run job, following the same pattern we already use for brand onboarding. The client submits a generation request, receives an immediate acknowledgment, and then polls for the result. Users now see progress feedback from the first second instead of a hanging request that may or may not resolve.

This is a well-understood architectural pattern, but it is easy to defer until timeouts become a real user complaint. We chose to address it before that happened.

WhatsApp Video Delivery

Jiwa AI delivers content to brands over WhatsApp, which is convenient but comes with a quirk: the Fonnte API, which we use to send media, does not always infer the correct file type from a URL alone. When a filename is absent, the API sometimes treats a video attachment as generic media and delivers it in a format that does not play inline.

The fix was a single-field change โ€” adding an explicit filename to the API call so the receiving client knows it is getting a video. It is the kind of bug that is invisible in testing and only surfaces when a real user receives a garbled attachment on their phone. Now reels land as playable videos, not ambiguous file downloads.

Influencer Diversity Enforcement

A content calendar is only as good as the variety it creates. In the original calendar generator, a single influencer could appear in up to half of all posts in a campaign. With a six-post schedule, that meant one creator could dominate three slots โ€” which narrows the audience reach and makes campaigns feel repetitive.

We tightened the per-influencer cap to two posts out of six, or roughly 33 percent. This forces the generator to spread content across a broader roster, which better reflects how multi-influencer campaigns actually work. Brands benefit from diverse tones, aesthetics, and audiences rather than a single voice repeated across the week.

The change required updating the constraint logic in the calendar generator, and the improvement in output diversity was immediately visible in spot-checks.

Quality Scoring Calibration

Automated quality scoring is one of the more subtle challenges in AI pipelines. The standard approach โ€” using a language model to judge the output of another language model โ€” works well in principle, but breaks down when the judge is too lenient. In Jiwa AI's case, we were using a smaller, faster model for quality evaluation. That model consistently rated content higher than human reviewers would.

We upgraded the quality judge to a more capable model and added an explicit calibration instruction: be critical and calibrated, not generous. This single addition dramatically changes scoring behavior. Without it, a model tasked with evaluation will default to charitable readings of ambiguous content. With it, the scores reflect the kind of honest assessment that actually separates good content from great content.

This is sometimes called the self-evaluation bias problem. A model that generates content is implicitly optimistic about its own outputs. Even a different model, trained on similar data, will inherit some of that optimism. Explicit calibration instructions push back against that default.

DNA Evaluation Persistence

Every piece of content Jiwa AI generates is evaluated against a brand's DNA โ€” the core aesthetic, tone, and identity captured during onboarding. For a long time, that evaluation happened at generation time and then disappeared. The score influenced whether a post was approved, but the underlying signal was never stored.

We changed this so that DNA evaluation results are persisted to each post record in the database. This might seem like a minor bookkeeping change, but it unlocks something important: the ability to analyze patterns over time. Which influencers consistently align with a brand's DNA? Which content types drift? Are there systematic gaps between what the AI generates and what a brand actually needs?

Without the stored signal, those questions cannot be answered. With it, the data exists to support future improvements โ€” better influencer-brand matching, smarter generation constraints, and more targeted feedback loops.

Small Changes, Compounding Returns

None of these improvements is individually dramatic. Together, they represent a more honest, resilient, and data-aware pipeline. Async generation removes a hard failure mode. Correct media headers ensure content reaches users as intended. Diversity constraints make campaigns more effective. Calibrated scoring produces trustworthy quality signals. Persistence turns ephemeral evaluations into durable insights.

The lesson is familiar but worth repeating: pipeline quality is not a launch concern, it is an ongoing practice. Each of these fixes was invisible until it was not โ€” and catching them early is always cheaper than fixing them after the fact.