> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hystersis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Graphs

> Using knowledge graphs in Hystersis

# Knowledge Graphs

Hystersis uses Neo4j for knowledge graph storage, enabling complex relationship queries.

<img src="https://mintcdn.com/hystersis-510bad77/wB-1lV8z0CzteIqk/images/knowledge-graph.svg?fit=max&auto=format&n=wB-1lV8z0CzteIqk&q=85&s=62c97ae1107fdf8e111126c59776849d" alt="Knowledge Graph Example" style={{width: '100%', maxWidth: '600px', margin: '20px 0'}} width="600" height="350" data-path="images/knowledge-graph.svg" />

## Entities

Entities represent concepts in your domain.

```python theme={null}
entity = client.create_entity(
    name="Python",
    entity_type="programming_language",
    properties={
        "created_by": "Guido van Rossum",
        "year": 1991
    }
)
```

## Relations

Relations connect entities with typed links.

```python theme={null}
client.create_relation(
    from_id=python_entity["id"],
    to_id=ml_entity["id"],
    relation_type="USES"
)
```

## Graph Queries

Execute Cypher queries directly:

```python theme={null}
results = client.graph_query(
    """
    MATCH (p:ProgrammingLanguage)-[:USES]->(m:Topic {name: 'Machine Learning'})
    RETURN p.name
    """
)
```

## Traverse Graph

Find connected entities:

```python theme={null}
paths = client.traverse(
    entity_id="root-entity-id",
    depth=3
)
```

## Use Cases

* Building ontologies
* Finding related concepts
* Recommendation systems
* Dependency mapping
