What is Knowledge Graph?
A knowledge graph is a structured representation of knowledge that organizes information as a network of entities (nodes) connected by relationships (edges). Each entity represents a concept, person, place, or thing, while edges describe how entities relate to each other, creating a web of interconnected facts. This graph structure enables sophisticated querying, reasoning, and inference that goes beyond simple keyword or semantic search.
Knowledge graphs typically store information as triples in the form (subject, predicate, object), such as (Alice, works_at, OpenAI) or (Paris, capital_of, France). These triples can be traversed and combined to answer complex questions requiring multi-hop reasoning. For example, finding "colleagues of Alice" involves traversing from Alice through her employment relationship to her company, then back through other employment relationships to find co-workers. This structured approach provides more precise retrieval than embedding-based methods for certain query types.
In AI agent systems, knowledge graphs serve multiple purposes: they provide structured long-term memory that persists across sessions, enable entity-centric information organization and retrieval, support reasoning that requires following relationships between entities, and offer explainable retrieval paths that show how information was found. Technologies like Neo4j, RDF triple stores, and property graph databases provide the infrastructure for building and querying knowledge graphs, while techniques like entity extraction and relation extraction populate them from unstructured text.