Insights Custom AI Development

Feeding AI with your data: API vs CDC vs batch vs RAG

These four are often compared as rivals. They are not: three get data to the AI, and one is how the AI uses it. Most working systems need several.

Tarun Pattnaik, Co-founder 23 November 2026 · 6 min read
HOW OLD THE DATA IS WHEN THE AI USES IT
Batch
hours
CDC
seconds
API
live
+ RAGthe search step that lets AI answer from your documents
Key takeaways
Batch, CDC and API move or reach data; RAG is how the AI uses documents when it answers.
Anything the AI changes must go through an API; slow-changing data is cheapest by batch.
The hard part is rarely the model: it is data that is fresh, trustworthy and permission-controlled.
Two different jobs

Getting data to the AI, and using it

Batch and change data capture (CDC) copy data to where the AI can read it. An API lets the AI reach into the source system live. RAG (retrieval-augmented generation) is the step where the AI searches for the relevant pieces and answers from them.

Strictly, RAG covers any information fetched and added to the AI's prompt, including facts from an API. In everyday use it means searching documents, and that is how we use it here.

BatchCopies or processes data on a schedule, for example every night.
Change data capture (CDC)Picks up each change in a database as it happens and copies it on.
API (live call)The AI asks the source system directly at the moment it needs something.
RAGSearches a knowledge base before answering, and can cite its sources.
At a glance

How the four fit together

In a typical design, documents and records reach the AI by different routes, and live facts are fetched on demand.

Documents
Policy wordings, manuals
Change rarely
Batch, nightly
Loaded and indexed
Knowledge base
Searchable
AI agent
Answers with RAG
Records
Core systems
Customers, claims
CDC, seconds
Each change copied
AI-ready copy
Customer view
AI agent
Reads it instantly
Live facts and actions
AI agent
Needs an exact fact
API call
With the user's rights
Core system
Answers or updates
Side by side

Freshness against cost and complexity

The right route depends on how current the answer must be, and how much data the AI has to search.

How freshBest for in AIWatch out for
BatchMinutes to a day, set by the schedule (usually hours)Slow-changing data, model training, scoring large volumesStale data; wrong for anything time-sensitive
CDCSeconds to minutesAn AI-ready copy kept close to live, without loading the main systemMore setup and monitoring; source database changes can break it
APILiveExact current facts, and actions such as opening a ticket or booking a slotSlower and costlier per call; depends on the source being up
RAGAs fresh as whatever keeps it updated (batch, CDC or event streams)Answering from your own documents: policies, procedures, contractsWeak search gives weak answers; permissions must carry over
Choosing

Four questions, in order

Ask these for each piece of data the AI needs. The first "yes" gives the answer.

Must the AI change something, or quote an exact current figure?Use an API. Payments and bookings always go through it; quoted figures come live unless a copy is known to be fresh enough.
Must it answer from documents and show where the answer came from?Use RAG, then pick how to keep its knowledge base current.
Would a few hours' delay give a wrong answer?Feed the data with CDC.
OtherwiseUse batch: the cheapest, simplest and easiest to check.

Two checks apply to every route. First, the AI must only use data the person it is helping may see: with an API that holds only if the AI calls it with that person's own rights, not a shared account that sees everything; with RAG, each document's access rules must carry over into search. Second, for regulated decisions, keep a record of which data and documents the AI used.

Worked example

An insurance contact-center agent

A customer calls to ask whether a burst pipe is covered and where their claim stands. One answer draws on all four routes.

Part of the answerRouteWhy this route
Is water damage covered under my policy?RAG over policy wordingsThe answer lives in documents and should cite the clause
Keeping the wordings currentBatch, nightlyWordings change rarely; overnight is fresh enough
Customer profile and recent claims, ready as the call connectsCDC into a customer viewDaytime changes matter, but the main system should not be queried on every call
What is my claim status? Please log a new claim.API to the claims systemMust be exact and live, and it changes data

Cases the agent should not handle alone, such as a disputed claim or an upset customer, go to a person with the call details attached.

The hard part of AI is rarely the model. It is getting the right data to it: fresh enough, trustworthy, and seen only by those allowed to see it.
Common mistakes

What goes wrong, and what it costs

Using RAG for live factsThe AI quotes yesterday's balance or claim status with confidence. Live facts belong to an API.
Calling APIs for everythingSlow answers, load on core systems and a bigger bill. Copy what the AI reads often.
CDC where nightly batch would doExtra pipelines to build and watch, with no gain to the customer. Start with batch.
Loading every document into RAGOld versions and drafts compete with current ones. Curate sources and keep one current version.
Copying new data but not deletionsWithdrawn documents keep being quoted. CDC carries deletions; batch needs a full refresh or a removal check.
Ignoring permissionsThe AI reveals data a user should not see. Carry access rules into search and test with restricted users.
No record of what the AI usedAnswers cannot be explained to customers, auditors or regulators. Log the data behind every answer.
Getting your data AI-ready

Let's design how your AI gets its data.

We map each use case to the right data routes, so answers are fresh, traceable and secure from day one.

St. Petersburg, FL+1 877-408-2536India+91 70442 05006kamlesh@qbitconsultingservices.com LinkedInPrivacy© 2026 Qbit Consulting Services