AI Agents for Marketing: Leveraging Mosaic AI to Create a Multi-Purpose Agentic Marketing Assistant
Summary
- AI center of excellence: 7-Eleven's AI center of excellence led the build of a marketing assistant that brings campaign support, strategy and copywriting into one tool.
- LangGraph orchestration: Mosaic AI and LangGraph route each request to a specialised agent, so a strategy question and a copy request follow different paths through the system.
- Governed content quality: Model selection and guardrails keep generated marketing material inside 7-Eleven's standards before it reaches a human reviewer.
AI Agents for Marketing: Leveraging Mosaic AI to Create a Multi-Purpose Agentic Marketing Assistant

Talk by Sailesh Bharathwaaj Krishnamurthy, Head of AI Center of Excellence, 7-Eleven Inc
Marketing professionals build campaigns, create content and use effective copywriting to tell a good story to promote a product/offer. All of this requires a thorough and meticulous process for every individual campaign. In order to assist marketing professionals at 7-Eleven, we built a multi-purpose assistant that could: Use campaign briefs to generate campaign ideas and taglines Do copy-writing for marketing content Verify images for messaging accuracy Answer general questions and browse the web as a generic assistant We will walk you through how we created multiple agents as different personas with LangGraph and Mosaic AI to create a chat assistant that assumes a different persona based on the user query. We will also explain our evaluation methodology in choosing models and prompts and how we implemented guardrails for high reliability with sensitive marketing content. This assistant by 7-Eleven was showcased at the Databricks booth at NRF earlier this year.
Databricks Named a Leader in the 2025 Gartner® Magic Quadrant™ for Data Science and Machine Learning Platforms: https://www.databricks.com/blog/databricks-named-leader-2025-gartner-magic-quadrant-data-science-and-machine-learning
Build and deploy quality AI agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
Chapters
0:00Introduction to 7-Eleven2:57Evolution of AI chatbots8:18Marketing assistant design13:10Advanced agentic architecture18:42Example workflow walkthrough29:34Implementation and tools34:18Results and evaluation37:16Future directions
FAQs
How does 7-Eleven's agentic marketing assistant work?
The system uses multiple specialized AI agents built with LangGraph, each assuming a different persona (copywriter, strategist, etc.). The assistant routes user queries to the right agent, providing tailored marketing assistance.
What can the marketing assistant do?
The assistant generates campaign ideas and taglines from briefs, writes marketing copy, verifies image-text alignment, answers general marketing questions, and even browses the web for research.
How does 7-Eleven ensure quality and safety?
The team implemented guardrails through careful model and prompt selection, plus evaluation methodology to test reliability. This ensures sensitive marketing content meets brand standards.
Who built this system and why?
Sailesh Bharathwaaj Krishnamurthy (7-Eleven Head of AI Center of Excellence) led development. The system was showcased at the NRF booth, demonstrating how major retailers innovate with AI.
Full transcript
0:00 Introduction to 7-Eleven
Good morning everyone. Uh. I lead the AI center of excellence for 7-Eleven. Um today uh we're going to talk about how we built an internal AI agentic marketing assistant to help our internal marketing teams uh with a lot of creatives. Um all right. So let's get started. So, um, I'll give you guys a brief introduction about 7-Eleven because the first thing I hear usually when I say 7-Eleven does AI is, oh, does 7-Eleven have an AI team?
Do you guys do AI? So, I want to give a brief introduction about what we do. Um, and then we'll talk about some of the early chatbots we built, what we learned from that. We'll go through the actual assistant architecture. We'll go through some examples as well. Um, and then we'll walk through how we actually built that using langraph and mosaic AI. and then towards the end we'll talk about how it you know actually uh worked out and then the next steps from here.
So 7-Eleven has a worldwide presence. You guys know that already. Um I'm pretty sure everyone here has at least gone to 7-Eleven um once in their lifetime. Uh established in 1927, one of the earliest convenience store chains. We were the first to offer coffee to go if you did not know. We were the first to offer self-s served soda fountains as well. And we were the first to offer convenience um store, our first convenience store to offer gas.
We also do delivery. If you didn't know, install the app right now. Um uh we do um delivery. Our app is called 7 now. Um we do delivery across US and Canada. Um 7-Eleven has about 85,000 stores um globally. We're about we're in about 1920 countries now. Um we have over 13,000 stores just in the US and Canada alone. And 50% of US population lives within 2 miles of a 7-Eleven. And that's huge because that helps us a lot with our delivery because we are able to provide faster delivery for convenience items specifically.
All right. You did see about merchandising and operations innovation. S1 also has a history of tech innovation. We did build six years ago our own in-house casheller store completely proprietary. We didn't um use any solutions bought outside. Um we built that in-house six years ago. We opened that for our employees internally. Uh has been functional ever since. Two years ago we also built an AI based self record based on learnings from that cash store.
Um a kiosk basically with cameras. So you can place your items on the platform. It automatically identifies them. Something that's not shown here is we also have our own proprietary fuel dispenser experience system as well. Um, all of these kind of help us, you know, manage our systems better because if it's built internally, we have more control over what we do. All right, moving on to chatbots. Show of hands. How many of you here have built chatbots in your organization but never saw it go to production?
2:57 Evolution of AI chatbots
Right? That's why I called it the chatbot graveyard because I think when the early models came out, the early Llama one, uh, Falcon, if you remember, we built lots of chatbots. Um, rag was the thing at the time, right? You chunk your documents and you kind of use vector stores. You use phase or like whatever quick vector stores you could use at the time. Um, we built um simple chat bots for internal documentation. We had our selfch checkout unit.
We had uh some troubleshooting docs for that unit. So, we're like, okay, let's create a chatbot where if something goes down, you ask a question and you're able to get answers. Yeah, the documentation was, you know, less. We've um we were able to answer questions easily because the documents weren't long enough. it was an easy use case. And then we were so confident, we went to the finance team and we're like, "Oh yeah, we we'll do a chatbot for you."
And then we got slapped right across the face because the documents were huge. There were like 60 70 page documents with lots of images and tables and graphs. Um so some of the learnings we learned from that were um chunking strategies. How do you chunk specifically? How do you pre-process your data? You don't, you know, um fade in whatever your OCR model gives you. you kind of summarize that sometimes you have to um store the right chunks in the vector database because what you store in the vector DB is you know it basically determines the accuracy of your overall system.
Um so that was one of our key learnings and then that helped us al also kind of start with some kind of multi-step reasoning. We didn't know it was called agentic or reasoning or whatever but at that time we did have multiple stages of our LLM. Each stage had a different prompt given to it and it did different um you know uh tasks. It took different personas. We didn't have a name for it but we kind of did that already.
Obviously it was slow. Um and I think we didn't have a lot of these LLM APIs at the time. Uh we didn't have bedrock. We didn't have data bricks mosaic you know um model um um hosting and all of that. So we used uh quantized models, we used llama models for that locally um to solve for that and then we exposed that as an API by you know uh uh using our own um you know AWS um uh services. That was a good start. We weren't able to productionize a lot of these applications.
We didn't actually make value but um as any AI engineer would say um that doesn't mean we fail. uh we learned a lot from that and um last year we had our own internal data and AI summit. We also built an internal chatbot for that to answer questions on session details, who's talking, what sessions are happening, where and when. We also connected that to teams, Microsoft Teams, that's our internal um communications tool.
Um yeah, sad not slack but um we were able to get a lot of users, unique users actually using this tool mainly because um it was easy to um access it was right there on teams and it answered basic questions like you know what are the sessions today? Um where are these sessions and then most of this was was hosted on teams um on teams meeting. So we were able to give a teams link right there and you can just watch from your desk.
Um we did that before datab bricks did their brick bot this year. So yeah um and we started that with basic rag what we learned in the last slide I showed you that did not work that well mainly because we made PDF documents we created clear chunks of each session speaker information all of that even if the vector uh vector database was good even if the retrieval retrieved you know the right chunks the final answer was not good enough because sometimes you have to give all the sessions in the day and you won't have enough chunks being retrieved sometimes then you have to like do dynamic retrieval it was too complicated hated.
So we had this ingenious idea quote unquote where we just made all the information um you know kind of sit within a UC table. So we made a session table, we made a speaker table, we wrapped that around in a genie space. I think genie APIs were in public beta at that time. So we got access to that. We exposed the space as an API. We connected that to teams and that worked. We did have to wrap around some business logic and some guardrails here and there but it worked.
Um like I said I think we had around um slightly less than 600 unique users um using that we had multi-step reasoning that is the architecture we wanted to implement we did not uh mainly because it had a lot of steps and it was a little slow if you had to go through all these individual steps you're not going to wait for like 3 minutes for an answer from a bot right um so the guardrails I mentioned the guardrails were basically just prompts we didn't have specific speific guard rails.
We explained in detail what the bot should not do and it kind of worked mostly. We had people ask about the salaries of all the summit participants. It did not answer that. Obviously doesn't have the data but it shouldn't hallucinate something right. Um it asked about email people asked about email addresses. People asked all sorts of random things. People yelled at it, cussed at it. It kept its school did not answer any questions.
It did exactly what we asked it to do. Basically give standard prompted answers. And that worked at that time because it was mostly internal users, right? All right. From there, we'll move on to the actual creatives assistant view here to talk about. So, all of the previous chat bots we built helped us learn a lot. One of the main things we learned when we did the god race, especially for the summit chatbot, was you will have to give very clear long form prompts.
8:18 Marketing assistant design
That was not natural for us. Like naturally you only give three or four line prompts, maybe 10 lines. It doesn't feel right to give a 20 50 line prompt, right? That did work really well for one of our older chatbots and we learned that maybe that actually works through experience. So that helped us, you know, kind of in the next steps and I'll walk through that. So when we got the first um introduction to the use case itself, there were a lot of external vendor companies obviously reaching out to the marketing team saying, "Oh, we'll build you this chat assistant that will help you with all the creatives, campaign ideation and all of that."
And we were like, "Oh, like any other AI team, I'll build that internally. I'll build that myself." Right? That's what we do. So we said, "We'll build a P. We'll try it out. We'll see how it works and then we'll take it from there." So the team wanted to use Gen AI. they didn't specifically have very clear requirements on like what the assistant should do but mostly the at least overall ask was it should help in ideation.
So our intent was to build a a governed genai chart interface um for creative work mostly and um it should be safe and controllable to some extent as well because obviously it's proprietary data you don't have want to input or ingest um campaign information that's not out yet you know into some tool um you know that can be used for training somewhere else. Um, so general enterprise problems. Um, and one of the main things that they didn't ask for, but we thought we should do is the only way for us to compete uh when you do a build versus buy is always make it custom to the features that the company or the team needs.
Um, that's like the main difference you can show because most of the tools I would say are going to be a little generic to cater to different audiences. But when you build internally, you can build for your actual users and that gives you an edge for all the AI engineers here. If you want your PC to succeed, that's what you do. Um, all right. So, the creative assistant assistant itself was basically the initial assistant at least was three simple bots in a trench code.
So, the first one basically does creative campaign generation. So, you can give basic information about your campaign. Um, you know, it's u a summer campaign for new flavor of slurpee. I'm targeting this geographic region, this demographic and all of that. You give the information the assistant basically comes up with campaign ideas. What what does campaign mean? It's usually um you know the way you communicate to customers.
So the taglines you use, the copy the uh the content you use to talk to them, the way the channel you use to talk to them as well, email, SMS, push notifications, um you know is it pop the posters in the store, is it ad on Facebook or whatever, right? All of this is uh you know comprised together as a campaign. So the campaign generator kind of helps you come up with that. That's the first. The second is a copywriter.
Copywriter, we separated these two mainly because the copywriter's whole job would just be to write copy. Writing copy is basically coming up with the actual content that goes to customers, right? Uh that is a separate job. You if you didn't know, you'll have a lot of marketing teams spend a lot of time perfecting copy, writing copy really well. Uh because that goes to customers. You can't mess up with that. The last was a general assistant.
We could not you know um restrict every single question that came in to just the two um bots mainly because there would be some general questions as well because people got used to chat GPT at that point. So they're going to ask some general questions. You cannot ask them have them ask any question but as long as it is related to marketing and campaigns you should be able to still answer that. If you you know kind of push them away for every single question they ask it's a bad experience.
So we also added in a general assistant that kind of helped with like generic questions. And this was our very early architecture quote unquote. Um we had a supervisor. So user asks a question. A supervisor agent basically takes that question. It's you can consider it as a switch case um uh you know function that basically finds the question finds the right bot to answer that question and then you know kind of sends that to the bot.
You can see the directions the arrows here are unidirectional which means the supervisor gets the question and then you send the answer to either the creative campaign generator or the copyriter or the general assistant and there's a final god layer at the end um that you know make sure we don't send anything provocative or toxic or anything to the end users um and then it goes back to the user itself pretty simple pretty straightforward this was our initial P it did its job right we were able to show that we can create campaign ideas uh we can create some copy for you and we can ask answer some general questions And this is how our um the UI itself look.
Pretty simple stream lit app. I know again AI engineers would know you're not have support building actual react applications to make it look good. Uh streaml is our savior always as usual. So we built a simple streamllet app. On the left you see some filters. Again when this goes back to me saying that we have to be very tailored to our users, right? because um every brand has a brand voice. Your brand talks in a certain way to your customers.
13:10 Advanced agentic architecture
You also tailor your content based on the uh the demographic you talk to, um the geographic area you are, you know, campaigning on and things like that. There are a lot of nuances there. So, we understood how the marketing team actually worked, you know, for all of these campaigns. Kind of added that as configs or drop downs. Basically, you can choose um things like, you know, uh tone of voice, the uh demographics and age, and you can even choose things like call to action.
Sometimes you want people to sign up for your rewards program. Sometimes you want them to click on a link and avail a promotion, claim a promotion, right? So, um adding all of this kind of helps. And in the back end, all of this is basically structured and then given as a prompt uh into the or added to the prompt that the user asks. So nothing too complicated in the back end but in the front end it makes it easy for the nontechnical user um to you know select options or like select different tones of voice and all these config parameters.
Uh easy on our end to just add that to the prompt. You ask a question and then you see uh the bot explaining what subbot the supervisor explaining what subbot it's sending the question to and then the actual uh tag lines right uh below that and then some explanation and reasoning for why it came up with that as well. One thing we saw practically when we were trying to uh build this out the PC itself was it is better to explain a little bit to give some reasoning on why it came up with this so that your users can ask follow-up questions and kind of tune the tagline because one thing we saw was they ask a question they get a tagline that will never get used in an actual campaign like they just use it for ideation right but we want the taglines that come out of this assistant to be used which means they need to perfect it.
They need to like ask follow-up questions and kind of like tune it, change a few words here and there. They can only do that if they know why it came up with that. Not really how although they're kind of similar, but why kind of explains like what conflict parameters helped it get there, for example, right? So they can go tune that, change those things and all of that. So um some amount of reasoning helped. We did try the early reasoning models to see you know if that reasoning helps that did not directly answer their question because reasoning models kind of think gives you their um you know how it got there kind of like thinking steps it's not exactly what the kind of explanation reasoning you see here uh and this helped most standard alms do this so we were able to u you know um work with what we have oops sorry yeah so earlier this year late last year earlier This year we kind of upgraded our um architecture to be more multi- aent.
Um again it's a it's a it's a term it's a keyword. Um what that means is you did see that in the past architecture that a lot of the arrows are unidirectional. You ask a question the supervisor decides what to do and then it goes to the subboard and then you get an answer. Right? That was not enough. You if you require a lot of follow-up questions to get to the final answer, it breaks the experience there. like you you do not save a lot of time that you think you're saving.
So one thing we wanted to add was actual reflection and like you know kind of thinking through the steps before it actually gave the final results. So that's what we did. You see a lot of birection arrows here. We also kind of moved our guard layer layer to um right in between the users so that the input is also screened sometimes so that you don't have them asking random questions. For the P we did not restrict that because we wanted them to use it.
We can't reject every question for something that passed that's passed the PC. We added the god layer in. You have you still have the three subbots. What you have extra here is you have tools obviously. Um we added the web search agent. If you're not doing web search for marketing, it's not really that helpful because you need to look at what um um you know what the in thing is right now. What other similar competitors are doing.
What if the tagline your LLM came up with has already be been used somewhere two months ago, right? That's terrible. So having a web sergent is really really important. That was the first tool we built. And then we have some more tools and I'll talk about that. The other things we added was we added reflection and then we added uh planning and distribution of work as well. Kind of similar but basically some kind of thinking and reasoning before it spits out something right.
And then the last thing is human in the loop. That was very very important. Obviously the campaign taglines and ideas and all of that are not going to be sent to the customer directly. That's horrible. If you make one mistake, you're done. So um we do have to have human in the loop. But the human in the loop we did was not just in the end. You could do that throughout the process because you don't have to wait for the entire thing to work and give you something and then a human reuse it and you start the entire thing again.
Um lang graph kind of helps you introduce human the loop in between the workflow itself. I'll talk about that in the later slides. Um, but we did use that and that's that's been really helpful. This is the um I think the graph that langraph generates for you know the graph workflow you created. I added that just because I showed you an architecture a few slides before and I said we did not implement that. The previous slide the architecture you saw there we did implement that.
18:42 Example workflow walkthrough
So I that's saying I'm not you know making things up. We actually did implement that. We have this uh working right now. Uh we have with web search agent we have the email um tool as well. We are adding more more tools after this. Now that I gave you a background I bored you with a lot of technical details. Um I'll walk through an example workflow because um sometimes campaign and you know ideation all of that is a little blackbox for people who haven't directly worked with marketing teams.
So I'll walk through an example so it's easy to understand. So um I mentioned you have something to start with, right? So you have a campaign, you have a new slurpee flavor or summer, right? You have summer of savings or you know summer of whatever. Um and you have a demographic, you have a geography you're targeting and all of that. All of that usually goes into a campaign brief. That's what marketing usually work with.
It's basically a word document with all the information. So you have a campaign brief um that has the challenge you're trying to solve, the objective, um the tone, look and feel, uh the desired reaction you're trying to get out of the campaign itself, and the mandatory elements to have. Uh sometimes you want to make sure some certain words always, you know, come in. Um for example, um 7-Eleven has a proprietary u brand called seven select.
Lot of seven select products in there. And if we are making a campaign for one of those products, that name should come in there, right? So you can add all of these. This is this is similar to the conflict parameters you saw in the earlier slides. Uh but usually this is what marketing teams already work with. They've been doing this for years. It kind of helps. So we let them directly upload files as well. And these files do not have graphs and charts and all of these tables.
So it's easier to read because it's just a a stream of bullet points. So the campaign dream, it goes through the god layer. The god layer basically validates to say is it right? Is it something you know um toxic or inappropriate? Just make sure we're doing what we're supposed to do. It says yes, go through and then that's forwarded to the supervisor. The supervisor basically starts by thinking. It did not do that before.
The supervisor basically just did an if else. Now it starts by coming up with a plan. Okay, I'll coordinate the development of the 7-Eleven summer of savings campaign. I'll do some web web research. I'll do some creative campaign concepts. um you know I'll do some multi multi- channelannel content and it comes up with these steps and it also has the context of what tools it has available all the sub agents it has available as well so based on that comes up with these um very specific steps to do and all of this is prompted in like you prompt it to do all of this so um that's the fun part about LLM you can tell it exactly what you want it to do and it does that nice right um so basically once it comes up with these um this clear plan.
First, it goes to the web search agent and basically asks the agent to search for specific information based on what's in the campaign brief. And if they had chosen a few more config um you know parameters like I showed in the first few slides, um it takes that in as well and basically tells web search agent to go and do a web search. And if you note here, it's not a web search tool. It's a web search agent. We're not hitting an API to do web search.
We are handing that information to an agent that has access to the web search API. We separated that out. You can do the tool which means the supervisor itself would be that agent, right? It would hit the API, get the information, do all the summarization, but the delegation of duties, the separation of duties really, really helps because it helps the LLM do what it's supposed to do really well. If you have this one supervisor agent kind of do everything and you have like all of these different things added to the same prompt, it will do everything a little um you know uh less mediocre like if you want it to do everything really well.
You want to have clear separation of um you know tasks and responsibilities. So the web search agent basically takes that conducts research hits the API gets the list of uh u things from the web web search API and then summarizes that and then it basically presents a research findings again we prompt in here to the agent itself to say give me you know only 10 bullet points or five bullet points don't make it too verbose like you can do all of this obviously it gives you very clear um research findings of what's going on out there what's the in thing you know is is there a trend going on in Tik Tok or whatever and then the supervisor takes that output.
So every time the supervisor is going to be the mediator, you could have the web search agent kind of talk to the next agents directly. I'll kind of probably talk about later um in this uh about why that is not the best. Uh but at least in our u use case, we have the supervisor kind of kind of get the outputs back from the agent and then get it send it to the next agents. Um and that works really well. So we have the supervisor basically get that information and it had the initial steps.
So it has the web search information. Now it goes to the creative campaign generator. Um and it says you know uh based on this research based on the campaign brief based on all of this conflict parameters now go and create uh you know uh creative campaigns for me. It says create three campaigns. Again, that was prompted in. You can prompt it to like do five, do more, whatever. And then your campaign generator basically comes up with three concepts or three campaigns.
It comes up with a a tagline, seven days of summer, summer bucket list, unexpected sevens. Um it comes with a story construct, a tagline, a framework of how to do the products you are actually promoting in that campaign. Um it comes with some visual direction, some execution ideas. So when I said campaign, campaign usually involves all of this. The campaign is what are the products you're promoting or what is the concept you're promoting?
How are you doing it? What are you trying to get out of it? Uh what is the execution plan? All of this, right? The entire thing is a campaign. So the campaign generator whose task is to just do this comes up with ideas. Supervisor takes that goes to the copyriter and says um if you can see here it's saying uh do it for the summer of savings specifically. Um goes to the copyriter and says give clear instructions on like give me a video script a radio script.
Uh copyrighter's whole job is to come up with the content itself that goes to the customers right so it comes up with scripts mostly. So the copyriter basically takes all of that information, creates scripts, a video script, a radio script, a social media post, an instore signage, app notification copies and all of that. Prompted in again we ask it to give all of this individually depending on your you know your business and your use case and different communication channels you have with your customer.
You can have it generate all of those things as well. Mostly we have uh video for ads on Facebook or whatever. Um you have radio because sometimes you do have you know speakers in the store that kind of read out some promotions when you're at the store itself. Um obviously social media posts in store signage lot of posters you see and then app notifications if you have installed the app pushing like short taglines through the app itself to know kind of get you into the app and you know maybe make a purchase or two.
Now the supervisor takes all of this information goes to the general assistant. So now that we have the campaign briefs, we have the copy as well, we we need to kind of put all of this together. Uh we need to um summarize this in a way that's consumable by the rest of the uh marketing team itself. So it goes to general assistant and asks it to like kind of come up with an actual execution plan. Again prompted in. So the general assistant basically comes up with a summary um a channel strategy like different language adaptation all of that.
The s the supervisor basically does a final review. This also again prompted in we want the supervisor to make sure it checks for certain specific um uh checkboxes that we wanted to have like for example it went through like these multiple steps to create final campaigns. If it misses a one or two we have to start from the beginning again and that's really slow. So we have the supervisor kind of reflect on some of the um key requirements we gave in internally.
Um it checks for that. If it doesn't work, if it was not enough, it goes back and starts the process again internally. It doesn't tell the user. So the user is not having to prompt again. But this reflection step helped a lot. It helps kind of um make sure there is a minimum level of quality in the answers you create. The last thing we added was basically um after the web search tool, we had the email tool. you can kind of email this information out to your marketing team.
Um, the other thing you can do is since there is a UI, they can ask these questions in the UI itself. All of these steps kind of show up on the UI. So, they can interrupt at some point if it's going off the rails, it's doing something you don't want it to do, you can interrupt and ask the question again. Um, you can show these answers in the tool itself or you can send out or you could remove the actual UI eventually have them upload campaign briefs to a central location in Google Drive or SharePoint or somewhere and all of this happens automatically in the back end, right?
All you get is you upload a campaign brief and then like in 2 minutes you get an email with all the information you need. You can use that or you can go and like ask it to change. uh but we would probably do that kind of automation only when the team is comfortable with probably the first few um you know um runs of the models results itself. Sometimes it takes them asking multiple questions. They're not fully confident with what the answers it gives.
So you would still have to want have the UI because you need some interaction. All right. So the email tool basically gives confirmation and then uh the supervisor basically um ends the loop. Um, we did, if you see, for every single step, come back to the supervisor. We didn't have the agents talk to each other. We could have had the campaign generator talk to the copyriter, talk to the general assistant and go from there.
It's faster. But, um, I'll talk about some of the handoffs um that we could do. And this worked out really well for us because there is some central LLM whose whole job is to supervise and reflect kind of looking for quality and the basic things we want. Um especially in probabilistic systems if you have everything chained every single system is probabilistic. If one goes wrong everything goes wrong. So the supervisor being there and kind of checking helps.
So that was an example of um one of the workflows. I'll go through how we use langraph and mosaic AI to actually build this. The first is easy tool integration. I'm sure you guys have already used langraph before. If you have not, I would say please do use it because it's easy to start using tools. You can actually even make a simple multiplier function um in Python and make it a tool with a decorator, right? So, um tools need not be APIs.
29:34 Implementation and tools
Tools need not be always something you talk to and call and get information. Tools can be something very simple that you want structured responses from and Langraph kind of makes it easy for you to do. You can bind these tools to the LLM. All of this is function calls uh for you while you're coding. It's orchestrated behind behind the scenes. Um so it's easy as a coder um to kind of build tools. The second is human in the loop which is what something we liked mainly because right now I showed you an example where we directly send an email.
Any of these intermediate steps could have had a human in the loop. Mainly what langraph helps you do is two different things. One is you can have the human kind of verify before a tool is called. If you don't want to do web search for everything because it's sensitive, you know, or whatever, you can have a human always step in and check what is being searched in the web before the assistant actually does. That does slow the process obviously, yes, but it gives confidence to end users.
That's one of the most important things, right? You have nontechnical teams actually using these tools. Software engineers, AI engineers are comfortable with a lot of these tools. we know that you know this is okay but sometimes you do have to kind of ease it in with your business teams. So having human reviewers in between helps a lot. Um I think the second thing was you could actually approve and reject um some steps as well based on approval and disapproval.
It would like kind of branch off to different nodes. It's it's good to have if um you know based on your human input if you want something to happen automatically. You don't want to have an AI engineer step in. A human in the loop agent can just do that and then like automatically entire workflow runs. It speeds up things. The third thing I really love is memory and persistence. Memory has been um at least in chat memory has been very common now.
You can ask questions within the chat and like follow-up questions and it works. It gives the context of your previous questions right there. That's almost not a feature anymore. It's an expectation. What Langraph also helps you do is multi-hat memory. So you can have um things summarized from the first chat you did and then stored in some kind of a memory and then in the second chat you can use that you can kind of retrieve that using some kind of vector database um and use that to like inform your answers for the second chat.
Uh this is especially helpful because like people have preferences and if you can transfer the preferences that's that's huge. It's personalization quote unquote again that's also a not a feature anymore. It's an expectation. If you open an app, you want to see what you like in there. Maybe five years ago, you were like, you know, this is scary. How does it know about me? But now you're like, why doesn't it know about me?
Right? So that's almost an expectation now. And Langraph helps you do that internally easily. They also have what's called procedural memory. The second um image you see there, um say your um LLM is supposed to create tweets for you, right? So it's a expert tweet writer or whatever. After a few conversations, it can learn that you do not want it to make hashtags at all in the tweets. That can be learned and automatically added to the prompt itself so that when it creates new tweets, it doesn't create these hashtags.
Um, all of this, like I said, is like experience improvements, but it adds huge value. Um, last is agent handoffs. And uh this is important because sometimes when you have agents talk to each other, you can either pass the entire context everything I saw take this you know do this next thing for me or you only give the right amount of information so that like it does exactly what it's supposed to do. You can do that really well with langraph.
Um this is where A2A also would probably come in um at some point. But when you have for example in our case the supervisor kind of being the supervisor in between all it does is give the exact information the sub agent needs to know. So you have like a supervisor agent and a sub agent you have state kind of shared between these two agents and you can just give the information it needs. It helps get very um you know accurate responses or at least passible responses.
If you give too much information too much information always confuses the LLM. The LMS don't hallucinate that much anymore. Like if you remember a year and a half ago, it was crazy. You don't see those hallucinations more. Now you see more confusions. Like it doesn't give you the right answer. It kind of deviates into something else. Right? So you can still maybe call it hallucinations, confusions, whatever. The one thing that we've seen work is give it the exact information it needs.
Nothing more, nothing less. That helps a lot. And then next is obviously data bricks and mosa. uh we built all of this within data bricks. We use some of the mosaic AI tools as well. The first thing that helped us really a lot is MLflow logging traces. You have multiple steps. You ask one question, the question transforms into multiple things throughout the um flow. You want to make sure what happens throughout the flow.
34:18 Results and evaluation
You can't wait for the final answer and then be like okay it works or it doesn't work, right? So the logging traces helps you look at what happened throughout the flow um front to front to the end. Um and while developing it helped us kind of come up with the right prompts because you want to tune your prompts obviously the first prompt is not going to work. So you have to change your prompts multiple times and this helps us a lot.
The next is pre-launch evaluation. Um you can actually create an app internally in data bricks that you can give to your users have them give feedback right there. It's been super helpful. Um we were able to do this initially uh and get some uh critical feedback. Um eventually we switched to streamlit as our PC tool as well. We actually use the actual app to get feedback but when you are in the early stages this helps a lot.
Um LM as a judge and data bricks agent evaluation. LM as judge is huge because you want to automate evaluation. You cannot have a human review every single thing. The agent evaluation helps you change your prompts and then every time you change your prompt you can check for groundedness, safety, relevance and all of that like just to give some scores on like you know changed prompt right you can basically compare it like you how you compare different models in MLflow.
Uh this has been pretty handy as well. And then last is monitoring. We have analysis and evaluation through inference tables. We use inference tables now a lot with um all of the models we serve. Um it basically logs everything back into a table in data bricks. uh very helpful to like quickly measure KPIs because they're going to ask how many questions you got asked today. um you know how many answers were good like you need this stored somewhere in table makes it easy.
God guardrails is the last. We um do have guardrails within AI gateway. You can do toxicity detection and PII but that only does it right in front of the foundation model. You want it wrapped around your entire flow, right? So what we did was we actually built our own guardrails as well as something similar. We used open source libraries and we made an API and we wrapped that around everything else. So that so in before foundation models we have AI gateways guardrails but around the entire tool we have our own guardrails as well.
The last is we did save a lot of several like lot of hours for manual review and setup time for every campaign. We also helped ideate faster because the non-measurable KPI is now you are able to do something that you didn't do before. Right? I I saved you a few hours a day or something, but now you're able to do something that you didn't do before, and that's that's even more valuable, especially in marketing. We did have a lot of good testimonials um quotes from our business users.
They did say they asked the vendors to stand down. They did say it's a game changer. The one I really like the most. I made a separate slide just for that is they called us better than GBT. we're going to print this and frame it in our office. But um since we were hyper tuned to the actual use case, that basically is the reason why they liked it more. Pretty simple. We didn't have our own custom LMS obviously. All right, I'll skim through some of the next steps from here.
37:16 Future directions
If you zoom out, we started with an aent, a text box and all of that, right? Eventually, you want to go from agents to action models that kind of does these things automatically and it's not just doing campaigns for you. That's almost dumb after a point. You wanted to know everything else about marketing as well. So marketing for example creates these email templates first and then the actual email HTMLs itself. Someone manually reviews both looks to make sure the text is right, the copy is right, the dollar off is right.
What if it's wrong? Right? Someone measure um basically checks this every single week. We were like, "Oh, I can use OCR, like I can use AI, quote unquote, that's been around for 20 years to basically do that, automate that and add that into the assistant itself so that it's not just an assistant that does um creatives anymore. It also automates some of our work. We haven't started using AI pass yet from data bricks. We use our own OC ensemble OCRs, but we will test AI pass next.
Um, the next is, this is what I love. We have all the campaign information of what worked and what didn't work basically stored back into a data lake from Salesforce. I can make a genie space out of it. What emails were opened? What SMS was opened? Which actually led to a purchase, right? Add that to the LLM as a tool. So when you are generating a campaign that's similar to previous campaigns, it can put basically query a Genie API, get performance stats of previous campaigns, use that to improve your current campaigns.
One thing you should be careful about is it can create a doom loop of, you know, you add one person improvement in email opens. It'll do exactly what worked last time. It'll do the same thing again and again. So we want to introduce some noise to make sure it doesn't go into that loop. But we haven't done this yet. We are going to do this and we're pretty excited. We have that in our architecture. We want to add Genie.
The last is AI generated image and videos. It is not there yet. I specifically added this because it shows a $50 slurpee. No one's going to buy that. Um, but I think image and video can be good starting points for designers to use before they actually create the file image because all of these tools are trained on images in the past. If you want to create an image of a new slurpee flavor, it's not going to be in the training data.
So, it's not going to be able to come up with that. You should be able to give new product uh images and then basically make it create uh images and videos from that. We're not there yet, but we are ready. We're kind of testing it, playing with it. Eventually, you want to be ready when it gets good. So yeah um that was all about the marketing assistants. Thank you so much for attending the session. I hope you are able to take away something from this.
Thanks again.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.