Saurabh Singh

Case Study · Personal Project

Xpanse.ai

A multi-agent marketing intelligence platform, engineered like production software: seven specialized agents across two checkpointed pipelines, grounded retrieval, and human-in-the-loop control at every strategic decision.

LangGraphAmazon BedrockNova ProRAGTavilyStreamlit

Most “AI agent” projects work in a demo and fall apart on real inputs: state drifts between steps, one bad tool call derails the run, and there’s no safe place for a human to step in. Xpanse.ai is my answer to that gap — a marketing intelligence platform that treats an autonomous agent as software to be engineered, with the same rigor I’d apply to any backend.

It runs two orchestrated pipelines: one that generates data-driven campaign strategy, and one that produces culturally-adapted content transcreation. Across both, seven specialized agents share a typed state, ground their output in retrieval, and defer to human judgment before committing — staying predictable, recoverable, and on-brand under conditions that break naive chains.

One request, two orchestrated pipelines, seven agents — coordinated over a single checkpointed state graph and a shared grounding layer.

Campaign GoalLangGraph StateGraphshared typed state · checkpointed01Campaign Strategy EnginePerformance SentinelRAGStrategic SeerWEBCampaign ArchitectFeedback RouterROUTE02Content TranscreationCultural ResearcherContent DrafterCultural CriticSCOREiterate ↻HUMAN-IN-THE-LOOPGROUNDING & REASONINGAmazon Bedrock · Nova ProKB · CampaignsKB · BrandTavily · Live Web

The StateGraph fans work out to the strategy and transcreation pipelines, each agent grounded in Bedrock Nova Pro reasoning, dual Knowledge Bases, and live web search — with a human-in-the-loop feedback path that resumes the graph from its last checkpoint.

Two orchestrated flows, seven agents — each with one clearly-scoped job.

Campaign Strategy Engine

Turns historical performance data into a validated, budgeted campaign strategy.

Performance SentinelMines historical campaign data through RAG over an AWS Knowledge Base.
Strategic SeerValidates findings against current market conditions via Tavily web search.
Campaign ArchitectSynthesizes the strategy — budget tables, flow diagrams, and messaging frameworks.
Feedback RouterClassifies user feedback and routes each revision back to the right agent.

Content Transcreation Pipeline

Adapts messaging for regional markets behind an authenticity quality gate.

Cultural ResearcherInvestigates local communication norms and consumer psychology.
Content DrafterAdapts the messaging for the target regional market.
Cultural CriticScores authenticity numerically, looping until it clears the quality threshold.
01

Checkpointed StateGraph

The system is a LangGraph StateGraph with checkpointing rather than a linear chain. Every node reads and writes a shared, typed state object, so control flow — loops, branches, and revisions — is explicit, inspectable, and resumable from any point.

02

Bedrock Nova Pro reasoning

All seven agents reason through Amazon Bedrock's Nova Pro model via the Converse API — a single, governed inference path instead of scattered SDK calls, which keeps behavior consistent and costs observable across the graph.

03

Dual Knowledge Bases + live search

Two specialized Knowledge Bases separate campaign archives from brand information, keeping retrieval both grounded and on-brand. Tavily web search closes the freshness gap so strategy reflects current market conditions, not just the corpus.

04

Human-in-the-loop control

The graph pauses at strategic checkpoints, accepts free-text feedback, auto-classifies the user's intent, and routes the revision to the relevant agent — resuming from the checkpoint instead of restarting the run.

The choices that separate a reliable system from a fragile one.

State synchronization & checkpointing

A single typed state is the source of truth across every agent, and LangGraph checkpointing persists progress. Together they eliminate the context drift that breaks naive multi-agent chains — and make any run resumable.

Human-in-the-loop routing

Instead of running autonomously, the graph interrupts at decision points and classifies free-text feedback to route revisions precisely. That turns the LLM into a supervised collaborator — the line between a demo and a business tool.

Grounded, on-brand retrieval

Separating campaign-archive and brand Knowledge Bases keeps answers factual and on-voice, while Tavily adds current context. Grounding is a first-class node in the graph, not a bolt-on, which keeps hallucination in check.

Quality gates over hope

The Cultural Critic assigns a numeric authenticity score that drives an iteration loop until output clears a threshold. Quality is enforced by the architecture rather than assumed — a deterministic gate around a probabilistic model.

Orchestration

LangGraphStateGraph + Checkpointing

AI & Retrieval

Amazon Bedrock (Nova Pro)AWS Knowledge Bases (RAG)Tavily Search

Interface & Runtime

StreamlitPython 3.14+uv

Deployment

AWS EC2