AI / LlamaIndex Interview Questions
What is the difference between PropertyGraphIndex and KnowledgeGraphIndex?
KnowledgeGraphIndex was LlamaIndex's original graph-based index. It uses an LLM to extract simple (subject, predicate, object) triplets from text and stores them in a graph store, with retrieval typically done through keyword matching or basic graph traversal from entities mentioned in the query.
PropertyGraphIndex is the newer, more flexible successor. It supports richer graphs where nodes and relationships can carry arbitrary labels and properties, not just flat triplets, and it offers pluggable extraction strategies, including schema-guided extraction where you define allowed entity and relation types, implicit extraction, or fully custom extractors.
| KnowledgeGraphIndex | PropertyGraphIndex |
| Simple (subject, predicate, object) triplets | Labeled nodes/relations with arbitrary properties |
| Mostly keyword-based retrieval | Supports hybrid vector + graph-based retrieval |
| Limited graph store integrations | Integrates with dedicated stores like Neo4j |
PropertyGraphIndex is generally the recommended choice for new relationship-heavy projects, since it also supports combining vector similarity with graph traversal in a single retrieval strategy, which the older KnowledgeGraphIndex doesn't do as cleanly.
More Related questions...