Introducing RAG 2.0: Agentic RAG + Knowledge Graphs (FREE Template)

Cole MedinAbout 3 min readJun 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • Agentic RAG (Retrieval-Augmented Generation)
  • Knowledge Graphs
  • Vector Database
  • Postgres with PGVector extension
  • Serverless Postgres (Neon)
  • Document Chunking
  • Embeddings
  • Graph Database (Graffity and Neo4j)
  • AI Agent
  • System Prompt
  • Cloud Code

1. Introduction: Combining Agentic RAG and Knowledge Graphs

The video focuses on a powerful AI agent that combines Agentic RAG and Knowledge Graphs for enhanced information retrieval. The agent intelligently decides where to search for information (vector database or knowledge graph) based on the nature of the query.

2. Data Storage and Structure

  • Vector Database: Postgres with the PGVector extension is used, hosted on the serverless Neon platform. Documents containing information about big tech companies and their AI initiatives, including partnerships, are chunked and embeddings are created.
  • Knowledge Graph: The same document is also stored in a knowledge graph using Graffiti and Neo4j. This allows the agent to query relationships between entities (e.g., companies). Example: "Amazon is where Anthropic hosts their models."

3. AI Agent Functionality and Decision-Making

  • The AI agent is designed to choose between searching the vector database or the knowledge graph based on the question asked.
  • Example 1 (Vector Database): Asking "What are the AI initiatives for Google?" prompts the agent to search the vector database. The agent then returns the answer and indicates that it used the vector database.
  • Example 2 (Knowledge Graph): Asking a question about the relationship between two companies triggers the agent to search the knowledge graph. The agent confirms that it used the graph search.

4. Explicitly Using Both Data Sources

  • The agent can be instructed to use both the vector database and the knowledge graph simultaneously. This can be achieved by:
    • Adjusting the system prompt.
    • Explicitly stating the desired data sources in the query (as demonstrated in the video).
  • When both sources are used, the agent provides a more comprehensive answer.

5. Tools and Technologies

  • Postgres with PGVector: A vector database extension for Postgres, enabling efficient similarity searches on embeddings.
  • Neon: A serverless Postgres platform, providing scalability and ease of use.
  • Graffiti and Neo4j: Graph database technologies used to store and query relationships between entities.
  • Cloud Code: Used to aid in the development of the AI agent.

6. Accessing the Template

  • The AI agent is available as a free template.
  • A link to the full video, which demonstrates how to build the agent using Cloud Code and how to get it running, is provided.

7. Conclusion

The video showcases a sophisticated AI agent that leverages the strengths of both Agentic RAG and Knowledge Graphs. By intelligently choosing the appropriate data source (or combining both), the agent can provide more accurate and comprehensive answers to complex queries. The availability of a free template makes this technology accessible for others to implement and experiment with.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.