A knowledge graph represents entities and concepts as nodes, then connects them with relationships. In retrieval-augmented generation (RAG), it links structured records with unstructured content so retrieval can preserve context and answer precise, interconnected questions. section 1.0 section 1.4
Use a knowledge graph when retrieval must combine semantic context with explicit structure:
- Store structured facts such as employees, tasks, dates, statuses, reporting lines, and company hierarchies. section 1.4
- Attach unstructured material such as articles or contract text to the entities and relationships it describes. section 1.4
- Query explicit relationships for filtering, counting, aggregation, and interconnected answers that text embeddings alone may miss. section 1.4 section 6.1
A practical construction workflow starts with raw documents, uses an LLM to extract parties, dates, terms, and other fields, serializes the result as JSON, and imports it into Neo4j. The resulting graph supports reliable retrieval for domain-specific questions. section 6.0 section 6.1
Legal-contract retrieval
For a legal chatbot, extract involved parties, contract dates, payment terms, and agreement status from contract documents. Store those facts and their relationships in Neo4j so questions about payment terms or counts of active agreements use structured data rather than only similar text chunks. section 6.1
Figure 1.14 A knowledge graph can store complex structured and unstructured data in a single database system.
Use the figure to inspect how structured records and unstructured article content coexist in one connected graph. section 1.4











