Great International Developer Summit (GIDS)

Graph Thinking with AI Algorithms That Power Real Systems - Rohit Bhardwaj

58:32 · 21 Apr 2026 – 24 Apr 2026 · YouTube

About this talk

This talk explores the rise and implications of graph databases since 2013, emphasizing their pivotal role in various AI applications. The speaker discusses how graph structures, consisting of nodes and edges, can effectively represent data relationships and solve complex problems. Various graph types, including directed and undirected graphs, weighted graphs, and knowledge graphs are explained in the context of real-world use cases like recommendation systems and contact tracing. Additionally, the talk delves into algorithms for traversing graphs, such as depth-first and breadth-first searches, and their applications in identifying cycles and optimizing routes. The speaker showcases practical examples of using graph databases like Neo4j and highlights the integration of graph technologies in AI systems for enhancing decision-making and providing insights.

Full transcript

So this talk actually came in because because everything which we are trying to do is an explosion. When you say explosion, what does explosion mean? Explosion means that from 2013 onwards graph databases exploded. Exploded like anything. Now if you have not worked on graph database, you are at the right place. If you have not worked on the graph with AI, you are at the right place. If

you have problems like the one which is Rag he's talking about, how to solve for it, we're going to discuss how to solve for that. Okay, and we'll discuss we'll discuss what are the typical problems a graph database can solve for today. Because because graph we all know graph is like, you know, has nodes and edges. Yeah, a node is there and an edge is there. They're

connected to each other. That's what a graph is all about. What that has to do with me? You know, we learned it in computer science sometime back, way back, something we did, you know, and then why are we talking about it now? Because you need to give the right instructions to solve the problem. Yes? Because we're not writing code, I understand, but instructions somebody has to write.

Yes? That's what you're here for. So we'll we'll not write I'm not writing code for you. I have a separate talk if you're looking for coding interview, you know, bootcamps like, you know, I have a O'Reilly sessions going there. Full day we'll discuss it more in detail what's going on there, but today is in the actually focusing on algorithms and how am I using in the real

system. Okay? That's the perspective. So I already use the graphs every day. Now I know which algorithm fits in production problem given to me. That's the question which we are trying to ask for. That is a promise for today. Right? Are we all ready? Say ready. Are we all ready? Okay, let's go. So, what's happening? Apache Airflow. Now, if you take a look at Apache Airflow, what

do you see here? Run this first branching and then run this and run branch this and then you're orchestrating and then you're joining at the end. What is this? You're developing scheduling and batch oriented task you're trying to do. A pipe Pipeline. Pipeline graph. Yes? It's a graph, you know. We're we're talking about graph, yeah? So, this is a graph. Looks like a graph to me, yeah?

So, this is called a directly directed acyclic graph. Yeah? So, this graph is used in many many many different places. Basil is there. To dependency graph. Dependency, you know, what are the different different dependencies are there. And then there is a possibility of cyclic dependency. Yes? That is also a type of graph which is given to us, A Jagger stack trace. Stack There's a stack and tracing

of that stack, yeah? That is also a graph. Context context context. You have a edge and a node to solve the problem. That means everything What? So, this is also a graph? Yes. These are all graphs and all the way to solve this is through graphs. Behind the scene is graph. Let's say, we don't see this, but that's what is behind the scene is also graph. So,

we'll talk about some of these things as as we talk about it. Let's talk about knowledge knowledge graph. So, knowledge graph, you all know nodes and edges, you know, there are properties associated to that nodes. Now, algorithm why we are trying to find the shortest path across different node which is coming to us. Uh you know, we are always doing some graph databases. They're Neo4j is one

of them. And use case recommendation engine. Okay. I would say which is not using graph right now. All the AI system, they're all using graph. So, we'll discuss that in in more detail. So, what does that mean? Knowledge graph is created Basically, it's a knowledge representation and reasoning. Ah. AI is doing what? Reasoning. Wow. Voila. So, that's exactly true. When graph came along, AI was not there.

People realized, I need to make it deterministic. How can you make user intent deterministic? Through We'll talk about how to do that. And that's where the knowledge graphs is is useful. And it's it's been built. Now, these are strategic intelligence. Now, now this is all graphs. Like, I'm not go all of them, but this is another which is there. And, you know, it's it's kind of a

node. Every node is connected to another node which is given to me. So, I can just go into artificial intelligence. And within artificial intelligence, I can go to ethical AI. And now, within the ethical AI, I can go to a particular one. They're all different different graphs related to each other. Yeah? So, what does that means? It means that when I'm processing any record any record I'm

processing, it'll be like, "Okay, that's good." Now, this is kind of a parent and child, This is kind of a parent and child. Like, you know, parent should be there, then child will be there. Uh, and database can also be there. Friend of friend, yeah? Friend of friend is also type of a graph, which is given to us. And there are multiple different types of graphs are

there, which we can do. And then, when we are solving for that graph, when we are talking through it, this is another one. Who likes this? That's it. Probably not, yeah. Contact tracing came along. So, contact tracing was that like, you know, if you think about it, one graph is connected to another graph. That's called as a contact tracing graph. So, I'm going to go little bit

fast here, but if you don't mind, just to make it, uh, you know, easier and to understand what's happening in the graph, it's good to understand it more. Okay, so I'm going to do this now. So, a graph can be of multiple types of graphs can be there, okay? So, this is the type of a graph which is undirected unweighted graph. What is it? Undirected unweighted graph

is there. Now, if you think about it, undirected unweighted graph can be of multiple types. See this? These are nodes, like, you know, which are some are connected, some are not connected. Uh, you know, and some of these problems actually come tree graph is there. Hierarchical graph, which is called a tree graph, can also be there for us to use. Bipartite graph, like these are adjacent adjacent

graph, which are given to you to solve a problem. Now, this is called a undirected Is used to find out who the popular person is, you know, influencer. Influencer, you can get influencer strategy you can get using this graph, yeah? Now, another type of is weighted undirected weighted graph. This is where the weight is involved. So, you have a weight involved here. These are different different types

of weighted graphs are there. Right? So, why do we have weights now? Anyone? Why do I have weights? Why do I add add a weight here? Yeah. Something has more importance than the other. It could be Google Maps. It could be weightage based on what decision you want to make. You uh you want to buy certain product while selling an insurance to a person based on their

criteria. You know, what weightage you should give for solving a problem. They are 35 years of age, they have two kids, what insurance policy they should have. They are 50 years of age, what kind of policy should I give it to them? So, that is all weighted graph we can create based on that and get the perspective for us. And this is called as Directed weighted graph,

which is not in circle. Yes? So, this is not in circle, but can I have a circle also? Circular dependency is there. So, it's possible there is a circle. Is circle good or bad? Huh? Sometime good. Sometime bad. It depends, like you know, um, about it. Next, see, circular means circle means like it will repeat again, you know? Uh, you know, if the market is going up,

it will go down. Yeah? Uh, you know, and then that's that's the sign of Is the sinusoidal wave is also kind of a circle, no? You're doing the same thing again and it trend So, trend analysis, trend analysis, you know? And um, you know, how many here do forecasting? For their for their pri- like your company do forecasting. What's the forecasting coming in? Say how many sale

will happen in the next quarter. That is a cyclical graph. You're looking at the past data and you're predicting the future data for you. Okay? So, those are all different type of graph. And then last one is directed weighted There is a direction there and there is a weightage also given to them. This is sometime used in Google Maps. Yeah? So, using these maps, now there is

an AI element to this also and we'll talk about that now. But basically, once we know that these are all the graphs which how do we use these graphs is it is a real question for us for us to work with, okay? So, let's see. So, we talked on these graphs. Now, the important thing for you is influencer. Why influencer? Because if you have an influencer, like

okay, for here, Virat Kohli, yes? Virat Kohli is a he he knows his lot of things, yeah? If he endorse something, you're going to buy it, yes? You know, Amitabh Bachchan, he does what? Like some ad he does not for eating the Bikaji, yeah? Yeah? So, people like to eat Bikaji. So, that's the he's a influencer. Based on the influencer, you are trying to come in and

then trying to sell more products. And that's the thing which is there. Shortest distance. I'm going to go from one place to another place. Shortest distance going from one place to another There's another type of graph is there. Rohit, why you talking about all these things? Because we will be using this in few minutes, you know? In a agent, where do I use it? I'll discuss, okay?

But, I'm just preparing for 15 10 10 minutes. Just hold on with me. Now, we have mutual interest. We all like soccer. I like soccer and then, you know, I like cricket and then I want to get more products based on the cricket. And and you can also have a disjoint graph like this. Disjoint graph can be used for what? Different different use cases, like mazes. You

can have a maze here can can be there in this one. That's That's another place you can you can use there. Now, this is important, you know? What is this? Christmas holiday, yeah? So, important thing is that you should not forget to get the flowers on your anniversary. Very important. Don't go home without that, yeah? So, uh so that is important, but what that has to do

with me? What that has to everyone here? Why am I spending time on this? Anniversary, yeah? Why? You know, huh? Gift. When? Who? You know, Mother's Day is coming? Yes? Recommend an assistant. Recommending, yeah. So, yeah, so for example, anybody in retail, what are we doing? We are creating a campaign for May, month of May. And you know, everyone buy for Mother's Day and then the Father's

Day comes somewhere and then it goes away, yeah? Sometime it comes, sometime not, but it's okay. Uh you know, but but the thing is that that is what is called as influencer. And then and then you're creating a campaign. Now, why are you talking about campaign, Rohit? Because you're getting sale. You know, somebody ask you a question, hey, value, what's the value of my agent? Without campaign,

without money, nothing. You can't get anything out of it. That's the value which you're trying to provide here when you're working on this, yes? That's the reason we're all here to make sure that our company get most amount of products when we are working on it. Directed graph is another one which we can create. So, I'm going to go a little fast here, guys, so if you

don't mind, you know, transportation graph, tree graph, graph traversal. We'll talk about graph traversal now. Depth first search and breadth first search. What is depth first search? This is a revision, we all know that, Depth first search is you're going to go down and come back up like this, yes? This is called depth first search. And and if somebody ask question like, you know, hey, you need

to clone. Clone. Uh if you need to clone, what do you How would you clone this data? If somebody ask you question, "Hey, I need to clone this this graph." How would you clone this graph? Using preorder traversal. And now, if somebody ask you question that like you know, "Hey, give me give me the give me the third largest value in this Kth smallest element in this

in this." What are you going to use for that? Inorder traversal. And if somebody ask you question that like you know, that you need you need to delete a particular node. Postorder traversal. Now, when we are doing these activities here, when I'm doing these activities you can do the same thing with the breadth-first search also. Everything can be done with each one of them. Depending upon the

usage, you're going to pick the breadth-first search or depth-first search. So, what that usage is? What do you guys think? When to use what? The order of the sequence. Huh? The Sequence? Like the nearest data by data. Nearest nearest data. Which one do you use in that case? With Breadth-first search. Very good. So, what's really happening is that this one consume the least least amount of memory.

If you have a memory constraint there, you know, it this one takes less memory. Like you know, less memory it takes, but it can go very slow. That's the only problem with the depth-first search is because it can become very slow to solve the problem. So, does the path exist? Somebody ask you question, "Does the path exist?" And within the nodes, if somebody saying, "Does this problem

exist?" Okay, let me ask the question differently. Does this stack trace this problem exist? What kind of uh search is this? Depth first search, okay? So, that's the you know the the the stack trace which we're trying to say. We can put it in the graph and that's that's what this is looks like. Breadth first search is the shortest path. If you need to find out the

shortest path, you want to use breadth first search. More memory consumption is there to do that. Does this path exist? And I'm going to go little fast here because if you don't mind, you know, because we are all pro at this like this is kind of a revision, yes? Yes? So, what what what will you use in this case? Breadth huh? BFS? DFS? Depth first search, yes.

Depth first search. Cyclic. You want to find cycles. What did you say? Yes. Depth first search, this is also depth first search. We are using depth first search for this one, yeah? Cycles. Cyclical cycles detection is there. This is also cycle. Stock market is kind of a cycle which is going on. Sometimes it's good, sometimes it's bad bad, you know? Um in a computer science we do

that. And if there is a cycle is there, sometimes it's bad. You know? And we use the depth first search for that, you know? Identify any deadlock. This this is a deadlock which is happening here. So, if I want to find out someone who also play soccer, I'm going to go here here here. I don't want to come back to the same person again. That's the reason

I I I don't want to do use cycles, you know? We want to avoid the cycles. And that's the reason we call it as shortest Shortest path first, you know, we want to create that's what what's happening. So, you know, I'm not going to go through the code here, but we got the idea on this one. Now, web. www, how would that How does that work? Huh?

With Breadth-first search, yeah? Why? Because I I I have to do this and then I have to do this, you know? So, breadth-first search will actually solve for the for spider. You're spidering, but you're only doing one level and then going to the next level, yeah? The next one is web crawler is there. Now, if you have been given this kind of dice and my daughter does

that like she does very very fast like for me like I spend a lot of time and say, "Okay, I'm done." Haha. So, for me it's not that easy to do. But what which What do you think we use for this? Breadth-first search for this one, yes. So, whenever you have been given to solve Sudoku problem like what that has to do with us, we'll talk in

few minutes, yeah? But that's where the breadth-first search is there. You're going from hit to cog and how many transformation before you do that? If the shortest transformation is then we are using breadth-first search to solve for that particular transformation. Then, breadth-first search in real life. This is important. This is more important than the other one, yeah? So, find the closest answer first. Find the closest answer

for the shortest hops in unweighted networks. How much is the What's the shortest hop to go from one node to another node to solve unweighted problem. If a problem is given to you Now, this problem you're going to give it to LLM. You know, not You're not solving this. LLM is going to solve for it, but you should be able to give this in a way to

solve this problem, you know? Um another one is nearest dependency blast radius. Oh, this is AWS like similar to the AWS like, you know, you want to nearest dependency blast radius is there. You want to contain the blast blast radius. breadth-first search. We are able to find out the dependencies across the system for us. Friend of friend recommendation. And expansion or recommendation is best for such. You

can say it's a best for such. Friend of a friend is a best for such, which is there. And crawler is also best for such. We talked on this one. Shortest step in state transition. Now, state needs to transition. I need to know someone who can introduce me to Venkat. You know, if somebody know if you know Venkat, you know Venkat? I can talk to you and

then you can introduce me to him, you know? Or yeah, I can go and directly introduce myself to him. But I probably go with you because you're an influencer, yeah? So, you'll be able to influence Venkat talk to Rohit today in the dinner, yes? We can do that. So, that's what is happening in this case. Now, production is simulate um So, this is what's happening in production.

If I want to work on the production area, which services are within two hops of failing authorization service? Which services are two hops of failing the authorization service? You're having authorization service and after the two hops, which other services will fail if that service fails? Best for such. Best for such. Behind the scenes is the best for such to do this, yeah? So, that is What is

the nearest warehouse that can fulfill this order? AWS uh Amazon got an order. It has to be fulfilled from some some location. Which one will be the fastest for me to do that? This is also best for such. Okay? Let's take a look at simulate a microservice agency list for payment service. Let's take a look at this one. Uh let me do that All right. So, so

we are trying to do breadth-first and then what we are trying to do is we are trying to uh run the run the query here in this case uh to solve this puzzle. So, what's really happening is Dream Mart is there. Dream Mart has a service. Okay, so I'll take a look at this one. So, what we are trying to do is that we are trying to

do breadth-first search for the payment service. Okay? So, what find the edges first. Payment service is calling order service, fraud service, notification service, and user service. Okay? Everybody with me? So far? And order service is calling inventory service and other services. Fraud is calling user service and other services. Now, based on that, based on that, we are trying to connect each and every service with each other.

Okay? Now, we are doing breadth-first search. Level one, order service, fraud service is there. Level two, for inventory service, I'm calling card Based on this these services, we can do the traversal of these services to really find out the shortest path to get the answer. Make sense? That's exactly what we are trying to do. Payment is not isolated. It's a graph hub, which is there, which is

given to you. You know, so that's the that's the main main perspective for us in this case. So, fraud path is deeper than order path. Order path is done. Fraud is happening. You need to find out the risk engine, apply the risk policy, and then get the get the policy for me. So, this is where we are using graph. You're with me? So, gra- graph is not

just used in a database. Graph is used in services also. When I'm calling one service calling another service calling another service, I can use the graph to orchestrate to solve the puzzle for me. That's the reason we are using the graph. You know, uh so and then AI specifically we are trying to implement here um in in this case. All right. So, that's good. So, we are

able to uh do Any questions? Yeah? Okay. You good? Okay, which downstream services will be impacted first? That's the question you're trying to ask. And then this is the LLM needs to find out what are the downstream systems are there which will be affected and work on this. Depth-first search and cycle detection. So, let's take a look at depth-first search. Go deep to understand the structure and

and reachability and failure traps. The traps will be there. You need to find out the problems as soon as they occur. How many of you are working on ambient agents? Like he was working on data quality, yes? Who's working on data quality? You A lot of people are working on data quality. See, main thing is garbage garbage out. Simple, like you know, it's like it's like, you

know, garbage in garbage out means like, you know, you create a prompt and you're asking uh LLM is most likely hallucinate till the time you apply this principle. So, that's the reason we are discussing it. Cycle detection workflows. So, you created a workflow, but there's a cycle in that. You know what will happen? You will have cost incurrence. Auto GPT search Google online. Auto G last year

last last year I was using that. Like it's good cost goes like very high, like, you know, uh every type Okay, this is funny. I was using uh Replit. Anybody use Replit here? So, Replit I was using and then, you know, it it got stuck in something, you know, uh and because it got stuck, I don't know what what the heck the code is written. I'm asking

fix this. And it's saying that it fixed it, but it really did not fix it. Uh did you guys face that problem? Yeah? And what do you do in that case? Tried one more time. Yeah? And every time you try, what happens? $1.50 gone. >> [laughter] >> Another $2 gone because it's doing a lot of math behind the scene. Like there are $200 goes like this. It's

not that It's It's It goes very very fast. So, that cost implication is there. If you don't know what to do, you're going to ask LLM to solve for it. Millions of characters. No. Use graphs and solve for it. That's the reason you are here for. Once you know how to solve for it, that's very easy. Deadlock, dependency loops, recursive config errors which are coming in, recursive

errors which are coming in. These are all depth-first search errors. And connected component discovery also you can do with this. Does the path exist? Production. A graph with cycle is not bad. A graph with unexpected cycle is bad. So, if you say that a graph with cycle is bad, no, that's not true. So, CI pipeline accidentally depends on its own artifacts in promotion job. That's a problem.

We need to detect this out. Approval workflow loops back to itself. Uh agent orchestration graph calls a tool that triggers the same agent again. Is it possible? Yeah, it's possible because because an agent is calling another agent is calling another agent. Now, if there is a loop, would the loop take place? Yeah. And if that loop happens, your cost will increase and you know, it will take

more time to solve that problem. And that's the reason we need to use graph for. Service A is calling B is calling A. Hidden loop is there, uh which is coming in for us. All right. So, time needed to inform all the employees. Like this is where we have a time component also. So, you can have a time What's the shortest time to go from one place

to another place? You know, that those kind of problems can also come in. Uh depth of a tree could be another problem. You want to find out how much is the depth for a tree uh for for we which I'm trying to solve Number of islands. So, when I say number of I'm not solving this, by the way. >> We going to take like 2 minutes to

solve this. I don't want to do that. But, the number of island, why do we have number of island problem? What are we really doing in this case, by the way? The effects join. You know, depth first search we can solve this problem for. I understand that, huh? Unconnected nodes which are there. That means whenever I'm trying to work on any solution, is it possible there are

multiple solutions to a problem? Directly. Yes. And that is number of island. Because yeah, you can have multiple solutions. Which one will be the Which solution should you pick? Which is the shortest of all the all all the For example, I'm a I'm I'm having a movie, uh you know, Meg Ryan worked on a movie, Tom Cruise worked on a movie. I want to find out the

shortest between the two where they are connected to each other. Can we because there's a those are all If I need to do that, those are number of island and I want to pick a island to solve a problem which is given to me. Make sense? That's the reason uh you know, we are using uh number of island as a as a solution. Connected components. Okay. Neo4j.

Neo4j database is used for property graphs. Now, this is a property graph which is uh How many here from Neo4j? Or you know Neo4j. You are from Neo4j. You can actually answer most of the questions here. But, really speaking, Neo4j is used for what? To store nodes, property which is in between, yes, what how the nodes are connected to each other and when they are connected to

each other what they are doing behind the scene. So, though that's the reason we have Neo4j as a graph. You don't want an inner class in inner line person movie ID and other one ID is there. It's very difficult to predict how much time it's going to take to solve this In that case, we are using a join statement to join all the data and I used

to write really feel proud to write these kind of sequels, you know. Not a good idea. Like you have to see what you're trying to solve for and in that case, you know, you can use uh you know, um Neo4j also. So, for example, I think I have it here. Let me see. So, I have the shortest path between the Bacon and Kevin Kevin. So, I want

to just let's run this one. Now, this is basically actors are doing movie. This is a very typical graph. Like we have everybody have seen this. But the reason I'm showing you is different. The reason I'm showing you is that that we have been given See this here. This is an important thing. It nothing to with this graph. I'm just going to show like you know, hey,

how these people are linked to each other. I'm just zooming right now. But the there is a reason I'm showing you this Is it possible that two nodes are connected to each other there are multiple values for this? Meg Ryan connected to the to this one? Yeah? Oh, 1 minute left? Are you sure? No, it's still 5:30. Okay. It's okay? Uh we have time, man. >> That's

fine. This is the shortest graph. >> We solved for it. But but the reason I'm talking about this the important thing which I'm talk The reason I'm talking about this is that Kevin Bacon is connected to Meg Ryan through the Apollo 13 and you have my you know Mary or or some other movie which is there. Now, the reason I'm showing you this one is that there

is a possibility of multiple answers to the same problem. Everybody agree? So, what you need to do to solve any problem? Try out? Shorter? Become greedy. Eat the chocolate first. Yes? >> That's what I do. Like you know I was like you know you know kids, they want the chocolate first, you know, no food they want the chocolate. The reason I'm saying that you have to become

greedy to solve these problems, you know? Shortest distance path you can solve with this graph, but is there a better way to solve this problem through greedy algorithms? And that is where the greedy algorithms are used to solve these kind of problem where I have Google Map, you know, Google Map can connect from multiple roads are connecting to each other. You can have 100 different ways of

doing that. It creates greedy algorithm to solve it. Okay? That's the reason like you know we want to do the greedy algorithm when somebody ask me an intent question. By the way, we're coming to that. It's good we have 30 minutes for that, yeah? So, because that's very important. Because somebody is asking an intent that hey, why this problem happened with this product? You know, I have

a product iPhone is there, why it's not starting or there's some problem is there. I need to find out the intent and solve for that intent. There are multiple solutions for solving that intent from different chunks which is there in the knowledge articles. You know? How would I get those chunks and get the value for only that product and find out relating to that product, what are

the cases recently which took place for that iPhone? Okay, you see what I'm saying here? You have a product, recent cases on the iPhone, and then find out what kind of problems are coming in. Based on those problems, now you're solving that. That is where using graphs. That is where we are using intent router. Somebody ask a question, how do you do I make it uh you

know, deterministic? You can't make it deterministic, but you can if you use Yeah, so that is called as graph thinking, you know, graph thinking. That's what we are trying to do right now. Think like graph, you know, that's what we are trying to do in this case. So, that said, uh uh Okay. So, that's what we did here. So, now we can create all these graphs, but

then also we added something called as rag LLMs. Like, we also added, you know, rag and vector database along with that. So, what is vector database really solving for? Similarity. Similarity search, yes. They're solving the similarity search. What is the problem with that? That's it. That's it. 60 of the table. Yeah. So, I'm going to do something here. Take a look what I'm doing here, you know?

I want to get Nike shoe endorsed by Ronaldo arrive in less than 2 days, okay? And this is what I'm telling you is very important to to understand what I'm doing here. The in 2 days, and you know, red shoe. Okay, that's what I'm trying to query here. Now, what's happening is behind the scene it's going to go in and searching the web, it's trying to first

find out understand just like our brain is understanding it, okay? It's querying different different availability brand in India. Because it found out I'm in India right now, you know? It found out and best match it able to give me 36,000 rupees. And there are some of them 11,000 better, yeah. And then we can get okay, 42, maybe 36 is better than. Yep. Okay. Now we got Now

you got the idea behind what's what's happening in the what's really happening behind the scene I'm going to talk about this. So, what's happening is, you know, it's for this product, you know, simulate the, you know, getting the rag. vector database. Now what I'm doing is I'm getting the value from the vector database and then retrieving the data. My red Nike CR plus shoe sole is coming

off after 2 weeks. I don't know why. Maybe their dog is doing it, I don't know. What should I do? Put it back in, man. But it's okay. You get the idea. So, basically what you're doing user is sending the intent out. Based on this intent we are doing a agent orchestrator. This agent orchestrator is doing the intent classification. Now based on this classification we are finding

out defect, recent purchase, and warranty for this shoes. Based on these three things, we are going to look at the policy of vector database. We are because I'm looking for the policy for the vector database, I have got five documents here. Okay? These documents are all having shoes manufactured in 30 days eligible for replacement. Take a look, this is important. Now I get this and I got

got the shoes context assembly done, reasoning and response is done for me. Uh now I'm going to get the get that answer for me, uh you know, building the solution, and then and then I'm retrieving that values, okay? So So that's one thing which we can do here. with adding with adding, you know, BM25. BM25 search. So BM25 is giving the context. Anybody here know how Google

searches? How How does Google search? Inverted index. In inverted index, yeah? Which is keyword search. It's doing a keyword search behind the scene is inverted index, which is kind of solve the puzzle for us. If I combine that with BM25, now what's happening is vector search with BM25 search I'm trying to do here, which is now doing BM search, the keyword search with vector search, and I

do something called fusion ranking. Fusion ranking means I get both the results, and I'm ranking that result, and I'm getting the value for here. And then when I do this query, product issue is there, and 2 weeks timeline, and I'm do the BM25 keyword search also. Now I get a better answer with the fusion search coming to me. Now I give weightage to BM25 60% weightage, and

and vector search and get the better answer. Everybody with me, we get a better answer with this. Same thing, if I do the same thing along with uh with and now now I'm going to add graph. graph DB you know, drag. So, we going to we going to do this also along with that. Now, what I'm doing is I'm just doing a fusion of that also. You

see what I'm saying? So, when I do the fusion of that my red Nike shoe has come in. Now, I added graph query also along with it, which is with the relationships. We talked on this. This is what we are talking today. You know, that's what we are discussing here. So, we did the fusion re-ranking and we solved the problem for us. Now, first thing which we

did was we found out the Parallel is done which is sometimes called as ensemble retriever. What are we doing here? We are calling it ensemble retriever calling that values for me BM25 vector search and we do the graph rag with product with issue type. Policy attached to it. Can I return it to a 15 days? Yes. Can I return it 90 days? No. Yeah? So, those policies

are there. Now, if I need to enforce the policy Oh. Look at this. I need to enforce the policy. That's where you use graph. Am I saying the right thing? He's he's from Neo4j. Who was from Neo4j here? So, you guys have used Neo4j, yeah? So, it is also doing the same thing. So, what am I doing? I'm doing a fusion ranking here to solve this problem

for us, okay? So, that's the reason we are using this in the AI. Now, once I use this in the AI, now I get get the answer. Now, I I I fusion all three of them. Because I did the fusion of all three of them, I got the LLM response Uh LLM output is, you know, this is a known issue with the CR25 shoes with multiple customers.

Since you have in within 30 days, we will be able to give me give me the product images. I really want to see your dog is not doing it for you, yeah? So, so something like that. Now, you have an action layer which is now result uh return the create request service is there. Graph graph because the graph frag is being called and without graph frag you

may be eligible for replacement. See this here? What are you going to do? Maybe maybe not. You don't know because there is no there is no policy defined. You you need to have a policy you need Now, that's the reason you are here in this talk. Everybody with me? So, that's the reason you're here so that you can apply graph frag to solve for this particular there

is a possibility that the graph is outdated, but I think I think it's it's fine. It still does the does a good job So, that is great. So, we are able to do graph frag. We also talked on graph frag. Basically, these are connected nodes are there. These are some of them which are available for me to use. These these are these all different different types of

graphs which are Social graph social networking graph is Now, one user is asking a question another is answering it. They create a social analysis and find out the sentiment of the user. And if the sentiment of the user is not good for your product or service, what can you do? What can you do? Talk to them. Talk to them. Improve the sentiment so your CSAT score increase.

Voila. That's the KPI you were talking about how the agents can be done. That's the way we are I'm trying to relate so that you can understand like the holistically where I'm using all these things in the agents. Yes? A supplier has a product and this is the This order when it's shipped it has a it has this shipper and this shipper is having problems. By default,

you can find out that problem and get that answer. Makes sense? So, that's is all added through there. Okay. Graph of thought, GOT, goat. Yeah? Uh yeah, so GOT is there when the problem itself is a graph shaped, the reasoning should be graph shaped, too. Why? Because like without graph of thought, you can't really solve for this. Now, chain of thought process is there. Now, when I

when I do the chain of thought process, let me go and do the chain of thought do Chain of thought process for above. So, I what am I doing here is that we are applying the chain of thought process with graph rag, vector, and graph rag I'm trying to apply that here. My red shoes, number one, do this. Number two, do this. Number three, do this. See,

this is sequence I'm trying to follow. Yes? Everybody with me? This is called chain of thought. Yes? Chain of thoughts. Now, there is another thing called tree of thought. Which is actually graph, you know, trees also are type of a graph, which is there. Now, if tree of thought lens if I Nike shoes is there, which I need to do that. Now, what's happening is where I

am kind of first look at level one, generate the competing hypothesis. So, competing What is competing hypothesis, anyone? What are the different possibilities coming to you? See this here. H1, H2, and it misuse and these three possibilities coming in. Now, you're trying to go to that branch. You're exploring that branch and seeing if that's an issue or not. Another branch, another branch, and this is tree of

thought process. And you can use this in the reasoning engine. If you use this in the reasoning engine, you'll be able to gather the be evidence for each branch using the vector and graph there and then misuse you're going to find all of them and based on that score is high. See this here? This is important what I'm doing here. This score is high. Just take a

look. And you're going to pick that branch and agent is going to say that I'm going to use this and final decision will be coming out of this. Upload the product and get the answer for you. Okay? This will give us a better answer for ourselves. Yeah? Now, apply the same thing with graph of thought, which is different. Okay, let's take a look at this one. Graph

of thought. Now, which is not graph rag, by the way. This is different which I'm discussing here. Graph of thought means my Now, what we're going to do is that goal is we need to find out create the nodes. We create the nodes and the edges. Yes? We created the nodes and we created the BM25 supports this. Based on that, now I apply graph of thought reasoning

engine to parallelly investigate and then find out which one is the contradictory handling is there and get the particular solution for myself. Awesome. Everybody good so far? Yes? This is the way we solve for graph of thought pattern. Okay. Let's solve for this. Example. With an example, okay? So, I got an example here because I think this is the most important thing. Everything else, like, you know,

we have time. Uh I think we have enough time to do this, yeah. So, this is a Dream Mart. Dream Mart is just like Amazon, yeah, which is there. Graph of thought pattern we need to use for this um and then orchestrate an engine we are trying to create. Now, this is the prompt which we are running right now, Use this common prompt, you know, Dream Mart

is a large organization, you know, you need to provide the current context And based on this context, so first you're going to define the context. So, I'm going to define here the context Okay, so I'm going to just command here context is I define the context. All right? Based on this context which I have defined here, the first prompt is using the scenario, Dream Mart scenario, build

a graph of thought pattern for the AI agent architecture for the e-commerce solution including the nodes, revenue growth, and fraud risk and other things like that. And your task is to do these things. Okay? I'm just going to do a few of them, but you to get you an understanding what's happening here. So, I'm going to run this one right now. So, what it is doing is

that it's a Dream Mart is there. You are an enterprise architect. You need to solve revenue growth business outcome. What is your business outcome? See, nobody asked okay, create an agent. Why should I create an agent? Do we ask that question? That's the first thing we need to ask like, you know, hey, what's your business outcome you're looking for? Check out success trust building. How you are

governing it governing it? You know, what's your decision quality looks like? What are the risks which are there? Who is the human in the loop for approval if needed? Now, based on that graph of thought is created, which is now giving the edges recommendation to graph revenue growth. It enables the revenue growth. This is the edge and this is enabling that one, yeah? Based on that, now

you have you have edges also noted for this one. Now, you write down the AI model plus edges with this one. Based on that, you are able to create risk fraud edges and other edges in this case. Based on this, now you can solve for any question the user is asking. Okay? So, let me tell you what question the user is asking for us. Give Solve. So,

utterances means what is an utterance? The user is asking this question. User is saying that I want red shoes under 8,000 rupees delivered by tomorrow. That's what is the latency plus conversion is there. Show me the best selling red shoe. You know, okay. So, instead of that, somebody ask a question, you know, uh you know, I want any shoe. Search everywhere in the world. Okay, somebody ask

this question. Search everywhere in the world, all the competitors, and give me 1,000 results. What does that look like to you? Complete graph. That is called as complete graph. That means the worst performance. Why? Because you're asking for the whole world. Hunger, like you know, I want to solve for everything, you know, you So, you need to find out you need to find out how much the

person is asking for. Am I filtering the data or not? If that is not clear, intent is not clear, ask the clarifying question. Hey, what color would you like to have? The color is not there. And this is sometime uh sometime called as understanding the user context before you send it to LLM. Sometime just by doing that, you know, somebody say, "Hey, I'm having a big cost

coming in, you know, quality is not good." You make sure that you ask this Once you ask this question, now you're able to for this problem, and then you're able to build a solution for yourself. Make sense? So, you can look at this more in detail, but I have here solved for, you know, a lot of prompts are there. I would suggest, you know, you can try

the prompts out to understand what's going on behind the So, RAG, we already discussed retrieval augmented generation. I think we talked on all these elements, you know, application layer, infrastructure layer, foundational model, and these models are all there getting the knowledge retrieved for us, and we are sending the response back to So, you can have a knowledge article published. Based on the knowledge article published, that article

is created through chunks. Yes? You're having different different chunks created, and then what you're trying to do? For a given chunk which is given to you, you're trying to find out whether this chunk will solve your problem. Yes? That's exactly what I was doing there, and that you're getting in from the knowledge articles, and then these chunks are added in the vector database Uh so, that would

be great for us to look at. Now, graph, who's using graph? Who's not using graph? I don't even want to drill down into each one of them. You got an idea, this is like every company in the world is using graph right now, you know? So, explosion is more because of AI landscape, you Uh you know, knowledge graphs are there which are being used to solve the

puzzle Now, you may ask a question, Rohit, this is all good. Okay, so can I have a graph created for unstructured data also? Can we have a graph created for So, that is what I was saying, graph RAG is structured data and unstructured data both together. If you combine both of them, because I'm doing a BM25 search also, which is structured data search. I'm also doing graph

search also to get the value for us. Now I can say that hey, for example, this graph is there. preview this graph. This graph is actually this is uh this is a wiki page. ChatGPT wiki page. If you see here, and I'm going to zoom in in one of them, this is most likely ChatGPT node, open API, introduction of API that these are all the nodes which

are connected to You see? So, what happens is any unstructured text can also be converted into graphs. Make sense? So, it's not just that it can be unstructured text can also be added here. And can I ask question based on this this also? Yeah, I can ask questions also. Give me when ChatGPT started? Now, this one is using graph search to get the values. Okay? This one

is using graph search to get the values in the and then returning returning for us. From the graph database, it's returning the values. So, you can also do the same thing with like, you know, SEC filing. There there are some examples are there. Stack uh Stack Overflow, you can you can use graph database you can create a graph database to solve the puzzle for it. Right? Now,

I'm going to do this in 5 minutes, but this is most important. Don't go anywhere. Okay? Everyone, promise not to leave. Okay? Because that's the right approach because you don't want to leave in between somebody's talking, okay? Just uh a good thing to have. But but this is for different reason. This for your own benefit I'm discussing this. 5 minutes only, okay? I take 5 minutes to

explain you this. You are here to solve for enterprise architecture. Yes, you're not here to solve for anything else like customer CRM solutions, marketing, sales uh so assurance solutions are there. Now, you are getting this data. You have to create a MDM solution for it. Master data management solution. Somebody is asking for data cleansing this, yeah? You need to clean that data and then apply the data

quality principle. That can be also done using graphs, okay? That's the reason I'm discussing it. And which data is there where? Logistics Does the logistics data needs to have a credit card information? Does the sales and marketing needs to have have a account information? No. And that's the reason we need to pick the right data and create survival of the fittest. When we do that, now I

know how to talk to Rachel. And which email I need to use to start talk to Rachel and apply GDPR compliance on top of it so that I can solve for any question they're asking and remove the data if I need to remove the data. To save the sensitive data before it goes to LLM solution. Make sense? So, that is the reason we apply something called as

knowledge graph system. So, I'll just show you this and we'll complete this for a second. So, what does that mean, knowledge graph? It means that we need to find out we need to find out from our side who are the different system, billing system and other systems are there. You need to ingest that data. Ingest that data into something called as data pipeline. Ingest the data into

uh Snowflake. Anybody using Snowflake here? Yeah? Uh yeah, you guys using Snowflake. Snowflake or data foundry like you know, there there so many tools are available. You're going to bring that data airflow and Nifty and others are there. ETL pipelines are there. Build that graph database for yourself. Now you are able to use the LLMs to solve the puzzle for yourself when you when you're working on

it. So, graph database, vector database are all living together to solve for a particular problem, okay? And when you apply these principles, now this is for Salesforce Data Cloud, somebody's asking a question, "I need to know who the contact is. I need to know the lifetime value for a churn prediction." I need to predict when they when they are going to churn. And based on that, that's

all done through graph, you know? We get the confidence uh relationship modeling we can use to uh to to get that perspective for ourselves, all right? So, that is another thing which is which is important to understand uh when we are building a particular solution. So, at the end, shortest distance path. So, when I'm working on the shortest distance path, what happens to the service company? And

we'll complete at this now. So, this is the service company which is there. You are trying to go you're trying to go from one place to another place, and and and and then I'm going to pick here Las Vegas, You need to go to all these places. It's going to take 30 minutes to solve a particular problem. You need to solve this through shortest You know, dependency

uh uh creation you need to do here to solve. You need to set the goals. Hey, you have two drivers. 15 minutes uh it's going to take 30 minutes to do it, Plan my routes. So, two drivers going in to solve for all these going to take around 5 to 6 hours to really solve for So, that is what we what we can do and and solve

for our puzzle when we are when we are working on the solution. So, what did we learn for today? We actually looked at graph as not just, "Hey, this is something which we learned sometime in our, you know, database way back, you know, in our computer science class, we probably learned this." But, we actually connected these graphs, uh, you know, in a in our usage, and then

and then build the implementation solution for us. I hope you can practically apply these principles, okay? If you have any questions, you know, I will be available uh, to answer. Um, otherwise, you have a wonderful day. And, uh, and see you guys tomorrow. >> [music]