---
title: "Introducing RAG 2.0: Agentic RAG + Knowledge Graphs (FREE Template)"
source_url: https://youtu.be/p0FERNkpyHE
captured_at: 2025-10-28
author: "Cole Medin"
contributor: "ชิดชนก"
platform: youtube
---
# Introducing RAG 2.0: Agentic RAG + Knowledge Graphs (FREE Template)

youtube video by **Cole Medin**, 38m48s, uploaded 2025-06-26. URL: https://youtu.be/p0FERNkpyHE
Tags: ai, artificial intelligence, ai agents, software engineering, software development, coding, automation, saas, development, graphiti, rag guide, rag tutorial, graphiti rag, rag knowledge graph, knowledge graph, real-time rag, rag strategies, pydantic ai, pydantic ai rag, pydantic ai agent, agentic rag, zep, zep ai, graphiti ai, neo4j, neo4j rag, open source rag, advanced rag, rag deep dive, rag kno

## Shared in LINE Note+
- 2025-10-28 00:05 by ชิดชนก

## Description
Traditional RAG systems only scratch the surface of what's possible. In this video, I cover an advanced AI agent I created as a free system for you that combines vector search with knowledge graphs to create a powerhouse of an agent that understands relationships, tracks knowledge changes over time, and reasons about complex connections between pieces of information.

This agent is very extendable and built with PostgreSQL + pgvector for semantic search and Neo4j + Graphiti for temporal knowledge graphs. It automatically chooses between vector search, graph traversal, or hybrid approaches based on the query.

I built the full package here - a complete implementation including semantic chunking, a vector database/knowledge graph pipeline, a FastAPI backend with streaming responses, and a CLI tool to chat with the agent.

Full source code (linked below!) included with support for multiple LLM providers. This is production-ready RAG.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Neon's free tier is more than enough to cover what you'll need in this guide! But if you do decide that you need to upgrade, you can sign up through this link and get a $100 credit:



I partnered with Neon t

## Transcript (captions:auto:en-orig)
Over the last couple of months, I have been diving deep into basically all of the rag strategies under the sun. I just want to find the best way possible to give my AI agents the ability to search through my knowledge. And the two strategies that I keep going back to time and time again are agentic rag and knowledge graphs. That's why I've been covering them so much on my channel recently. And the best part is it's actually very easy to combine the two strategies together to create some extremely powerful knowledge retrieval systems for our AI agents. And that, my friend, is what we're going to be diving into today. So, buckle up because I've been pouring a lot of time into building the perfect neatly packaged agent template, showing you the power of using both vector databases and knowledge graphs for rag. So, in this video, we'll see how it works. We're going to kick things off with a demo right away. Then we'll dive into why Agentic Dragon knowledge graphs when it applies. I'll show you how the agent works and I'll even show you how I use cloud code to help me build this template for you. So with that, let's go ahead and dive right into it. So to show you the power of this agentic system very quickly, I have a demonstration here in the command line. So I built this simple command line interface talking to my agent that is hosted through an API endpoint. And this agentic rag agent has access to both a vector database and a knowledge graph through agent tools. So it can pick and choose how it explores the knowledge that I've ingested in my knowledge base. And I can show you what this looks like actually. So first of all I'm using Postgress for my vector database taking advantage of the PG vector extension. And so I'm using the neon platform for Postgress. Now this is a SQL database. It's a lot more than just a vector database, but I can use my PG vector extensions. You can see that I have the embeddings here for all of my document chunks like you would see with very traditional rag. And just for a super simple demonstration, I have a single document in my knowledge base. Right now, it's all about AI initiatives for big tech companies like OpenAI and Microsoft. And so I have this document chunked up and embedded and stored in my knowledge base in Neon. But then I also have it in my knowledge graph. So I'm representing information in a different way very relationally here to give the agent the ability to explore the knowledge in a different way. That is what agentic rag is all about. And so I can zoom in on this a little bit and we can see a couple of examples like Amazon relates to anthropic because Amazon has invested into anthropic. If you didn't know, all of the anthropic infrastructure runs on AWS. And I can go down, we can see some other examples here, like maybe how Microsoft and OpenAI are partnered together because OpenAI, it solely uses Azure for hosting OpenAI models. And so we can kind of see how these companies are coupled together. So, this is a really good example of when we'd want to use both a vector database and a knowledge graph because when we're thinking about AI initiatives for big companies, we want to look at how companies are doing things together like Amazon and Enthropic and OpenAI and Microsoft, but then also if we want to just look up individual information on specific companies, maybe it's better to go to the vector database. And this is the kind of reasoning that we want to allow our agent to perform as it is answering our questions. That is all available to it now. So we can ask a question like for example what are the AI initiatives for Google and this under the hood is going to search the vector database. It doesn't need to do the knowledge graph in this case and we'll actually see this here. I say the specific tools that the agent used. So in this case it just did a simple vector search querying for the Google AI initiatives. And here is our answer. This is looking really nice. Then for another example here I can ask a different kind of question seeing how two companies relate to each other. the kind of thing that would definitely call for a query to our knowledge graph. So, for example, I could say, how are OpenAI and Microsoft related? Kind of a silly question, but I just wanted to explicitly call out something that would cause it to search the knowledge graph. And so, this time it'll do that. There we go. We use the graph search with the query OpenAI Microsoft relationship instead of going to our vector database. And we got a good answer talking about Azure, how it's the sole provider for OpenAI models, just like we saw within our graph visualization in the Neo4j dashboard. And then just for one last example here, I can ask a kind of question that I would want to use both the vector database and the knowledge graph and then just see what it comes up with. So I could say like what are the initiatives for Microsoft? How does that relate to anthropic? And then I can say use both search types. And so I'm just explicitly calling it out here, but what you can do is in the system prompt for your agent, and we'll dive into this in a little bit. That's where you can be very clear when you'd want to use the different search strategies based on the specific data that you have in your knowledge base. And so there we go. We use both the vector search and the graph search. And so first, we are looking for just Microsoft AI initiatives. Once we have that information, we hone in more by doing a comparison between Microsoft and Anthropic, seeing maybe how their strategies relate. I'm not totally sure exactly. It's just kind of a example that I pulled out of my butt, but yeah, I just wanted to show you how we can watch it use these different strategies and I set up this CLI so that we can see the different tools that it's using in real time. This is all a part of the template that I have for you. And by the way, if you are curious, the tech stack that I use for building this knowledger graph agentic rag agent, I have everything listed at the top of the readme. These are all libraries and tools that I absolutely adore and I cover all these on my channel quite a bit. And then also in the Dynamis community. So podantic AI for my AI agent framework. That's really the core of this agent is podantic AI graffiti for our knowledger graph library working alongside Neo4j which is the underlying knowledge graph engine that's the user interface that we saw earlier with all of the nodes we got Postgress with the PG vector extension to essentially turn a SQL database into what can act as a vector database we have fast API for building our agent API in Python and then finally the AI coding assistant that I used to help me build This entire agent is claude code which is an absolute beast of an AI coding assistant. And you can also see a couple of files that I have in the repo here to give you a glimpse into how I was working alongside Claude code. And towards the end of the video, I will dive more into how I use cloud code to build this. So definitely stick around for that as well. So we will dive into the agent template that I have for you in a little bit, how you can get it up and running yourself as well. But before we do that, I want to dive more into a gentic rag with you. Hopefully through that demonstration, you already have a sense for how it works and why it's so powerful. But I still want to talk about how rag has evolved to this point and also how knowledge graphs play really well into this. Here we have an article from Weevate, which I've shown on my channel before because I've talked about aentic rag before. I'll link to this in the description of the video. They talk about traditional rag versus a gentic rag, making a very clear comparison. And I appreciate this article a lot and there are two main diagrams that I want to cover here. So the first one is what is called vanilla rag. Some people call it naive rag, classic rag. …
