# Knowledge Graphs

> A design pattern that stores knowledge as typed entities and named relations, validated against a schema, so queries can traverse them.

Record: `architecture:knowledge-graphs`
Kind: pattern
Layer: [Correctness Core](https://banes-lab.com/records/layer/correctness-core.md)
Severity: contextual
Scope: knowledge modeling, retrieval, reasoning
Canonical: https://banes-lab.com/ontology#architecture-knowledge-graphs

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Vector Search](https://banes-lab.com/records/architecture/vector-search.md) and before [Explainability](https://banes-lab.com/records/architecture/explainability.md).

## Repair

- Refactored by: Extract Entities/Relations, Build Graph
- Detected by: repeated need for entity relationship traversal
- Violated by: relation-heavy domain modeled only as unstructured text
- Measured by: graph coverage, query accuracy
- Enforced by: schema/ontology validation

## Requires

- [Entities](https://banes-lab.com/records/lexicon/entities.md)
- [Relations](https://banes-lab.com/records/lexicon/relations.md)
- [Schema/Ontology](https://banes-lab.com/records/lexicon/schema-ontology.md)

## Reinforces

- [Semantic Consistency](https://banes-lab.com/records/architecture/semantic-consistency.md)
- [Explainability](https://banes-lab.com/records/architecture/explainability.md)

## Enables

- [Relationship-Aware Retrieval/Reasoning](https://banes-lab.com/records/lexicon/relationship-aware-retrieval-reasoning.md)

## Conflicts with

- [Flat Document-Only Knowledge](https://banes-lab.com/records/lexicon/flat-document-only-knowledge.md)

## In tension with

- [Curation Cost](https://banes-lab.com/records/lexicon/curation-cost.md)

## Tensions

- [Knowledge Graphs / Curation Cost](https://banes-lab.com/records/tension/curation-cost-knowledge-graphs.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Model Architecture](https://banes-lab.com/records/architecture-category/model-architecture.md)

## Linked from

- [Systems built around a model](https://banes-lab.com/software-architecture/scale/systems-built-around-a-model.md)
- [Model Architecture](https://banes-lab.com/ontology/principles/architecture-category-model-architecture.md)
- [Schema / Canonical Data / Semantics](https://banes-lab.com/ontology/principles/architecture-category-schema-canonical-data-semantics.md)
- [Model Architecture](https://banes-lab.com/ontology/lexicon/lexicon-category-model-architecture.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)

## Evidence in the code

- [loadReferences](https://banes-lab.com/source/tree/core/generated/reference.generated.ts.md)
- [mountReference](https://banes-lab.com/source/tree/presentation/widgets/reference.widget.ts.md)
