Almost Timely News: 🗞️ How to Connect an AI Agent to a Data Source (2026-07-19)
A reader request!
Almost Timely News: 🗞️ How to Connect an AI Agent to a Data Source (2026-07-19) :: View in Browser
The Big Plug
👉 New book! 21 Use Cases of Generative AI For Marketers
👉 Please take my 6-question Reader Survey to tell me what you want!
The drawing winner for the summer survey is Tiina! I’ve emailed you.
Content Authenticity Statement
99% of this week’s newsletter was made by me, the human. You’ll hear AI music generated by Suno in the AI montage. The video shows ChatGPT Codex working on the app construction. Learn why this kind of disclosure is a good idea and might be required for anyone doing business in any capacity with the EU in the near future.
Watch This Newsletter On YouTube 📺
Click here for the video 📺 version of this newsletter on YouTube »
Click here for an MP3 audio 🎧 only version »
What’s On My Mind: How to Connect an AI Agent to a Data Source
This week, a direct request from my reader survey, how to connect a data source to an AI agent. Reader requests are how I know what you want to read, so if you haven’t filled out the survey, although the prize drawing has ended, you can still potentially win something - an answer to your question.
So let’s dig in with a bit of table setting first.
Part 1: What is an AI Agent?
I’ve written about this a bunch of times but it bears repeating: an agent is a piece of software that does something without you and returns its results to you.
A real estate agent helps you buy or sell your home but does a lot of work without you, once they know your requirements. A travel agent helps you plan a vacation. An insurance agent sets you up with a policy. A Wifi negotiation agent on your phone connects you to a wifi network.
Agents do stuff without you. Here’s how you know if you’re using an agent or not - after an agent has started a task, if you are still providing input, feedback, and steering throughout the process, it’s not an agent.
Imagine a personal chef who was asking you at every step of the way how you wanted a step of the recipe cooked. That’s not an agent; an assistant, yes, an agent, no.
If you give a personal chef a solid recipe, ingredients, a good kitchen to work in, and your preferences, the next thing that should happen is a plate of your food appearing in front of you. That’s an agent.
In the AI Maturity Framework by Trust Insights, I detail 5 levels of AI:
Level 1, done by you: You’re doing most of the work. These are tools like ChatGPT and its kind, chat assistants where you’re doing the work, copy pasting, etc.
Level 2, done with you: You’re doing half the work. These are tools like GPTs, Gems, Claude Projects, etc. Where you’ve got a standard operating procedure in place but you’re still handling a lot of the outputs and conversational turns.
Level 3, done for you: You’re doing little of the work. These are tools like Google Antigravity and Gemini Spark, ChatGPT Work, Claude Cowork and Claude Code, OpenCode, etc. You give them project plans and all the necessary pieces up front, and they do the work. This is the first truly agentic level.
Level 4, done without you: You’re doing almost none of the work. These are tools like OpenClaw and Hermes Agent that run nearly autonomously. Once you’ve used a Level 3 tool to set them up, they do their thing, they self-learn and self improve.
Level 5, done ahead of you: Agents proactively working on your behalf. There aren’t any production-level systems like this yet, but they have persistent memory and self reflection, enough to know that if you’ve asked for a monthly report for the last 3 months, it’s probably a safe bet you’ll need a monthly report this month and they proactively do it for you.
When we talk about connecting agents to data sources, we are talking Level 3 and up.
Part 2: What is a Data Source?
Okay, this may seem silly, but it matters. When we say connect an agent to a data source, what do we mean by a data source? Remember that fundamentally there are two classes of data source, structured and unstructured.
Structured data fits in tables and spreadsheets neatly, and is usable in those tools.
Unstructured data doesn’t.
For example, let’s say you have some customer satisfaction data. Some of it will be structured, like what rating someone gave you on a scale of 1 to 10. A spreadsheet filled with numbers is very clearly structured data because you can work with it in that environment.
Some of it will be unstructured, like the free form responses people give. “I used your Turbo Ultra Vacuum to try vacuuming up the leaves in my 200 acre forested yard and it didn’t work, your product sucks, I want a refund” would be unstructured data.
Knowing what kind of data you want to connect to an agent matters a lot because it will dictate how we get the data to the agent, and what the agent will need to do with it.
The second thing that’s important to know is the difference between deterministic and probabilistic, fancy terms for “things that have no random chance” and “things that have random chance”.
In general (and yes, there is nuance and variation), structured data tends to be deterministic which means you need non-AI tools to work with it. It often requires math, and AI isn’t great at math.
In general, unstructured data tends to be probabilistic and ideal for AI to work with. AI can think through what a comment means, what topics or subjects it’s about, and even determine things like sentiment or emotional intensity.
Beyond the kind of data you have, the even bigger question is how the data is available. I assume if the goal is to have an agent working with your data, then you’d probably not want to babysit the agent by hand feeding it data. Hand feeding animals is fun. Hand feeding agents is not.
That means the data has to be available in some automated fashion, which can mean:
An API (application programming interface), a dedicated computer interface that serves up data, requires you to have AI write code to talk to it
An MCP (model context protocol), an AI-specific data connector that’s very resource intensive but requires no additional code
A web page, which means AI has to use a browser or browser-like code to scrape the data and extract it
In general, an API is your best bet for data because AI is very good at writing code, and when you use code to extract data, you incur no AI usage. One of our overall goals is to only use AI for things it’s good at, so having regular code (deterministic) to extract data is the way to go.
Part 3: Building the Requirements
Now that we’re clear on what an AI agent is and what data sources we’ll be using, we can get to planning out our agent. You should never, ever just wing it when it comes to building an agent or working with agents because every use of the agent costs usage or money. The more you plan, the less likely it is you build something that will be a flaming disaster and send you ridiculous AI bills.
To plan this out, we’ll use my favorite fictional company, the Savory Oatmeal Company. Imagine that they care very much about the price of oats and want to know what the prices look like on any given day so that they can plan ahead.
For planning purposes, we’ll use Katie Robbert’s 5P Framework by Trust Insights™:
Purpose - What is the question we’re trying to answer? What is the problem we’re trying to solve? Why are we doing this?
People - Who should you involve? Who needs to know about this? Who are the stakeholders, the customers, the people impacted?
Process - How will we answer this question, solve this problem? What are the specific methods, processes, techniques, and tactics involved?
Platform - What tools will we use, digital and analog? What data will we use? Where does that data live?
Performance - How will we measure success? How do we know we solved the problem? How do we quantify success? What KPIs and outcomes do we need to achieve?
So here we go. This is what the plan would look like:
Purpose
The purpose of our agentic app is to obtain and forecast the price of oats based on available market data so we can forecast and understand how our costs, as the Savory Oatmeal Company, will look in the next 90 days.
People
Our primary audience is the CEO of the Savory Oatmeal Company, James Avena. James is hyperfocused on cost containment because he believes that non-sugary breakfast foods are a critical offering. Not everyone wants sweet-flavored breakfast, and some people who are sugar-intolerant also don’t want to be consuming scads of artificial sweeteners, so his goal is to make savory oatmeal affordable to everyone.
Our secondary audience is the CMO of the Savory Oatmeal Company, Marsha May. Marsha runs the marketing and needs to know how much value messaging to put into the marketing for the next quarter.
Process
The process for forecasting this data is fairly straightforward, and needs only a few old-school AI capabilities, capabilities that pre-date generative AI:
Data collection: we get the data from a reliable source, like the St. Louis Federal Reserve Bank. Oats are a commodity, and are publicly traded, so we can obtain solid, multi-year pricing data for it. (If this were a real project, we would also gather data on Savory Oatmeal Company’s top flavorings such as chicken, beef, and bacon)
Data analysis: we use MACD - moving average convergence divergence indicators. This classic method, borrowed from the stock market, looks at the short and long term moving averages of any time series. When the short term falls below the long term, prices are falling. When the short term rises above the long term, prices are increasing. We’ll also use an ensemble of time series forecasting techniques such as Prophet, S-ARIMA/SARIMAX, etc. To get the best possible 90 day forecast along with confidence levels. We’ll also ask our AI tool of choice for other statistical and predictive methods that would be a good fit for analyzing a single time series.
Data reporting: we’ll use generative AI to take the analysis products and draft them into usable formats like an HTML/CSS dashboard that provides a nice, high-level executive briefing for James and Marsha.
If this sounds vaguely familiar, it should - this is fundamentally ETL (extract, transform, load), a data science methodology.
Platform
To build our agent, we’ll need a bunch of different moving parts, all with a common base platform. Because so many data science tools use Python, Python 3.12 will be our programming language of choice. We’d want to include some coding standards for Python 3.12 to ensure that we create high quality software.
For the actual agent, none of what we’re doing requires the latest or greatest AI models - and that’s a key consideration. The lighter an LLM we can use, the less costly and lower impact they are on natural resources. For this particular project, a local LLM would be ideal - no cost, and sustainably powered.
We’ll need a free API key from the St. Louis Federal Reserve Bank, or FRED, and the specific data series we want to extract. The Federal Reserve has monthly data for free; if we need more frequent data, we’d need to scrape it, which is outside the scope of this demo.
https://fred.stlouisfed.org/series/WPU012203
Because this is monthly data, we’d need to use 36 months of back data for forecast ahead 3 months, because any seasonality in the data is likely to be yearly (as is usually the case for anything agricultural). However, we’ll need to instruct our AI coding agent to be wary of data from 2020-2022 because the pandemic caused such massive distortions in every known market; using data from 2023, 2024, and 2025 is probably more reliable. We’d also need to account for geopolitics as well; the shipping issues in the last 6 months due to the Iran war have caused distortions in shipping prices as well.
We’ve already specified we want the output to be HTML with CSS; even regular HTML can have some nice interactive charts and graphs with libraries like d3.js and chart.js, both of which are available from CDNJS (Cloudflare’s cloud-based javascript service, also free). To ensure consistency in the report, we’ll likely want a YAML or Jinja template as part of the build that the tool can reuse over and over again when the LLM is doing the writeup of what happened. Rather than reinvent the wheel repeatedly, if we give it solid templates up front, it’ll have to work less hard.
Finally, we need to know what kind of agentic platform we’ll be using. For this project, I chose ChatGPT Codex to assemble it, and then probably an LLM like Google’s Gemma 4 or Qwen 3.6 to do the report writing.
Performance
What does success look like? For this project, success looks like two things. First, whatever code we write has to be free of bugs. It has to have 100% test coverage for both unit tests and end to end (E2E) integration tests, meaning that each piece of code works independently AND works together, and there’s no code that doesn’t have a corresponding test. It also has to pass safety tests; there are free testing tools in Python like Bandit that can make those assessments. Finally, it has to run and do what it’s designed to do.
Downstream success is a report that lands on James and Marsha’s inbox on the last Friday of each month with the 3-month forecast in it, following the SAINT Reporting Framework by Trust Insights:
Summary: a one-page summary for a fast read that calls out what decisions need to be made
Analysis: a walkthrough of the data - what happened?
Insights: an explanation of the data - why did the data move the way it did?
Next steps: what decisions need to be made? What should the reader do next?
Timeframe: when do decisions need to be made and plans need to be executed?
For this report, because it’s a rolling 90 day window report, every month, James and Marsha would get a report telling them what oat prices are likely to be in the next 3 months in a clear, prescriptive way. James would need to alert his buying team, and Marsha would need to inform her marketing team.
Part 4: Creating the Software
With this detailed plan, we’d then work with our coding agent to ask clarifying questions and once done, build a formal product requirements document, technical specification, a multi-part workplan, and then actually implement it.
Here’s a key thing that we’ve talked about in past issues and in my book Almost Timeless - if you use a very smart foundation model to do the planning, you can use a much smaller, faster, and cheaper model for the implementation - perhaps even a model that runs locally, like Gemma 4 31B or Qwen3.6 27B, both very smart local models. Even if you’re using cloud-based models, you can switch to a faster, cheaper model for the implementation.
After the software is created, tested, and debugged, you’re ready to launch your agent. By this point, you’ve made sure every piece works, from grabbing the data to doing the forecast to producing the report. You’ve worked out all the issues, perhaps even gotten stakeholder feedback, so all that’s left is putting the proven, working agent into production.
Part 5: Wrapping Up
I know I make this sound easy, because I’ve done it dozens of times. Your first time through will be a very bumpy road. Think of it like a podcast - your first ten tries will not be great, but after you’ve done a dozen or so agents, you’ll be well-practiced and will know where things are likely to go off the rails.
But when we talk about agentic AI, this is an example of what we’re talking about, what a real agent looks like that goes off, does stuff on your behalf, and sends you its work. It’s not ChatGPT. It’s not something that nags you every three minutes for your input. It’s a self-contained application that happens to use AI as part of it, but uses a bunch of other proven technologies along the way.
You can see what a big difference there is between this and a chat-based app, night and day. You’re doing very little of the work once you’ve built the agent - it just does its job and sends you its work for review, freeing you up to do something else.
If you spend the time to get the agent right, if you spend the time to plan it well, you can deploy dozens or hundreds of agents like this to take on individual tasks and make your life so much easier.
How Was This Issue?
Rate this week’s newsletter issue with a single click/tap. Your feedback over time helps me figure out what content to create for you.
Here’s The Unsubscribe
It took me a while to find a convenient way to link it up, but here’s how to get to the unsubscribe.
If you don’t see anything, here’s the text link to copy and paste:
https://almosttimely.substack.com/action/disable_email
Share With a Friend or Colleague
Please share this newsletter with two other people.
Send this URL to your friends/colleagues:
https://www.christopherspenn.com/newsletter
For enrolled subscribers on Substack, there are referral rewards if you refer 100, 200, or 300 other readers. Visit the Leaderboard here.
ICYMI: In Case You Missed It
Here’s content from the last week in case things fell through the cracks:
Stop Overpaying for Chatbots: How to Tell if an AI is Actually an Agent
Stop Paying for the Same Prompt: How to Use AI to Build Permanent, Zero-Cost Solutions
Stop Asking AI for New Ideas and Start Using It to Refine Yours
Is the Next Generation of AI Already Here? How to Build Your Own Fable Ensemble
Stop Wasting Money on AI: The Ultimate Guide to Choosing the Right Model for Every Task
Almost Timely News: 🗞️ How To Do Feature Engineering with AI (2026-07-12)
On The Tubes
Here’s what debuted on my YouTube channel this week:
Happy MAICON Day 2026 - MAICON BUILD Preview with Christopher Penn and Trust Insights!
You Ask, I Answer: Enterprise AI And The Junior Talent Pipeline?
You Ask, I Answer: Building Audit Trails For Enterprise AI Agents?
Almost Timely News: 🗞️ How To Do Feature Engineering with AI (2026-07-12)
My Merch Shop
I’ve been adding so much stuff that I’ve decided to bundle it all in what I call a Merch Shop, because otherwise there’s literally too much to keep track of and I run out of space in my own newsletter.
So welcome to the Merch Shop!
Books:
Skills for Claude and Agentic AI:
LLMs.txt Skill - generate an llms.txt file for your site based on your real data.
Job to AI Skill and Plugin - unpack any job description into what AI can and can’t do
Courses:
Subscriptions:
Recent Talks
These are just a few of the classes I have available over at the Trust Insights website that you can take.
From Text to Video in Seconds, a session on AI video generation
Never Think Alone: How AI Has Changed Marketing Forever (AMA 2025)
Powering Up Your LinkedIn Profile (For Job Hunters) 2023 Edition
Building the Data-Driven, AI-Powered Customer Journey for Retail and Ecommerce, 2024 Edition
The Marketing Singularity: How Generative AI Means the End of Marketing As We Knew It
Advertisement: New GEO 201 Course
In GEO 101, the first course I built on the basics of GEO, I taught you about presence, appearance, and relevance, the three phases of GEO, and what you need to do in each phase to align with how AI search operates.
The top piece of feedback we got at Trust Insights about it was, “okay, great, but how do I tell my boss that we’re ‘winning’ at GEO?“ After I quelled my murderous rage at your boss on your behalf, Katie and I sat down and worked out a straightforward, aligned methodology for doing this.
GEO 201 is based on the three phases, what you can control and what you can genuinely see - and critically, what you can’t. Because there is absolutely no way to say your brand “ranks higher” in AI search, period, end of story.
But you can say and show with confidence what you’ve done and how you show up for presence, appearance, and relevance with tools you’re probably already paying for, and based on how AI search systems really work.
👉 GEO 201 is available now for USD 149.
Get Back To Work!
Folks who post jobs in the free Analytics for Marketers Slack community may have those jobs shared here, too. If you’re looking for work, check out these recent open positions, and check out the Slack group for the comprehensive list.
Head Of Growth Marketing (Ugc, Influencers & Paid Media) at Clockout
Senior Director, Paid Marketing (Remote) at U.S. News & World Report
Disclosure: I source these links from LinkedIn every week on the following criteria: New in the past seven days, Easy Apply on, remote roles, USA geography.
How to Stay in Touch
Let’s make sure we’re connected in the places it suits you best. Here’s where you can find different content:
My blog - daily videos, blog posts, and podcast episodes
My YouTube channel - daily videos, conference talks, and all things video
My company, Trust Insights - AI help
My podcast, Marketing over Coffee - weekly episodes of what’s worth noting in marketing
My second podcast, In-Ear Insights - the Trust Insights weekly podcast focused on data and analytics
On Bluesky - random personal stuff and chaos
On LinkedIn - daily videos and news
On Instagram - personal photos and travels
My free Slack discussion forum, Analytics for Marketers - open conversations about marketing and analytics
Listen to my theme song as a new single:
Social Good: Ukraine 🇺🇦 Humanitarian Fund
The war to free Ukraine continues. If you’d like to support humanitarian efforts in Ukraine, the Ukrainian government has set up a special portal, United24, to help make contributing easy. The effort to free Ukraine from Russia’s illegal invasion needs your ongoing support.
👉 Donate today to the Ukraine Humanitarian Relief Fund »
Events I’ll Be At
Here are the public events where I’m speaking and attending. Say hi if you’re at an event also:
MAICON, Cleveland, October 2026
SMPS AI Conference, Austin, November 2026
MarketingProfs B2B Forum, Boston, November 2026
There are also private events that aren’t open to the public.
If you’re an event organizer, let me help your event shine. Visit my speaking page for more details.
Can’t be at an event? Stop by my private Slack group instead, Analytics for Marketers.
Required Disclosures
Events with links have purchased sponsorships in this newsletter and as a result, I receive direct financial compensation for promoting them.
Advertisements in this newsletter have paid to be promoted, and as a result, I receive direct financial compensation for promoting them.
My company, Trust Insights, maintains business partnerships with companies including, but not limited to, Amazon, Talkwalker, MarketingProfs, Agorapulse, The Marketing AI Institute, Spin Sucks, and others. While links shared from partners are not explicit endorsements, nor do they directly financially benefit Trust Insights, a commercial relationship exists for which Trust Insights may receive indirect financial benefit, and thus I may receive indirect financial benefit from them as well.
Thank You
Thanks for subscribing and reading this far. I appreciate it. As always, thank you for your support, your attention, and your kindness.
Please share this newsletter with two other people.
See you next week,
Christopher S. Penn




