AI series · Part 1: GenAI and Knowledge Modeling
Knowledge Graphs: Answering the Questions Vector Search Can't
Knowledge graphs store facts as a network of relationships. They answer chain questions like "who approves Rahul's leave?" that text search struggles with, and they pair well with RAG.
A knowledge graph (KG) stores real facts as a network: things are nodes, and relationships are the lines between them. Each fact is a triple: (subject, relationship, object).
If the ontology is the house blueprint, the KG is the actual house with people living in it. It works like a family tree: "Who is my uncle?" is easy to answer by following the lines.
Knowledge graphs you use every day
- Search "Sundar Pichai" on Google. The info box (CEO of → Google, born in → Madurai) comes from Google's Knowledge Graph.
- LinkedIn's "People you may know" follows links like you → worked at → TCS ← works at ← friend.
Facts in our HR assistant
(Rahul, worksIn, Sales)
(Rahul, reportsTo, Priya)
(Full-time, governedBy, Leave Policy)Now ask: "Which policies apply to Anita, and who is her department head?" The graph simply follows the links:
- Anita → Intern → Intern Policy
- Anita → Engineering → Arjun
GraphRAG: using both
Use a vector database for fuzzy text questions ("what's the rule on remote work?") and a knowledge graph for exact relationship questions ("who approves Rahul's leave?"). Combining both is called GraphRAG.
I use a vector DB for fuzzy text questions and a knowledge graph for exact relationship questions like 'who approves Rahul's leave'. Combining both is called GraphRAG.
- The short version
Next in the GenAI series: SHACL: Validation Rules That Keep LLM-Extracted Data Honest
Start from the top: GenAI Quick Answers and Series Guide
We deploy these patterns across production engagements in fintech, healthcare, and eCommerce. Talk to a senior engineer about how they apply to your platform.
