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

# Relationship graphs

> Store structured facts as entity-relationship triples the Agent can traverse.

Some memory is naturally graph-shaped: *Alice → works at → Acme*, *Order 42 → refunded on → 2026-07-15*. Storing these as **relationship triples** lets the Agent traverse — following relationships to answer structural questions.

## Where relationship graphs fit

You can store this info as free-text notes and rely on retrieval to find them. That works. But relationship graphs are better when:

* The Agent needs to **answer multi-hop questions** ("who else works at the same company as Alice?").
* You have **canonical entities** with stable IDs (customers, products, tickets, projects).
* You need to **filter or aggregate** over relationships ("how many refunds did we issue this quarter?").

## Structure

A triple is `(subject, relationship, object)`. Both subject and object are entities with IDs. The relationship is a named edge type.

```
(customer:alice) --[works_at]--> (org:acme)
(order:42)       --[refunded_on]--> (date:2026-07-15)
(order:42)       --[belongs_to]--> (customer:alice)
```

Entities can have attributes (name, created\_at, custom fields) beyond just an ID.

## Creating a graph memory space

Choose **Index** type when creating a memory space, and turn on **Graph mode**. This enables the entity/relationship model on top of the standard vector index.

## Writing triples

From an Agent:

* Use the `remember_fact` tool with `subject`, `relationship`, `object`.
* Or turn on **Auto-extract triples** on the space — Nora extracts entities and relationships from freeform Agent notes automatically.

From the CLI:

```bash theme={null}
nora memory triple <space> \
  --subject "customer:alice" \
  --relationship "works_at" \
  --object "org:acme"
```

## Traversing

The Agent gets two tools when attached to a graph space:

* **`recall_facts`** — retrieve facts about an entity by ID or name.
* **`traverse`** — follow edges. Ask "what does Alice work at?" and get the answer as a set of `(entity, path)` pairs.

Both tools are automatically added when a graph space is attached.

## Bidirectional edges

Relationships can be marked **symmetric** (`same_as`, `sibling_of`) so traversal works both ways. Or explicitly directed (`works_at`, `parent_of`) with a defined inverse (`employs`, `child_of`).

Configure per relationship type in the space schema.

## Entity resolution

Multiple mentions of the same entity should resolve to the same node. Nora auto-resolves on:

* Exact ID match.
* Alias match (list aliases per entity).
* Fuzzy name match above a similarity threshold (adjustable).

Manual merge available: **Space → Entities → select duplicates → Merge**.

## Contradictions

If a new triple contradicts an existing one (`works_at` says Acme, new triple says Beta), Nora doesn't silently overwrite. It flags the contradiction for review or, if you turn on **auto-supersede on conflict**, the newer triple wins and the older becomes historical.

## Graph vs. causal graph

Relationship graph memory is entity-relationship data the Agent accumulates. A **causal graph** (see [Causal Graph overview](/build/causal-graph/overview)) is a domain-authored graph of cause-and-effect variables, used for verification and analysis. Different tools, different jobs — you can use both.
