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

# Memory Schema

> Define extraction rules and re-process to rebuild a brain's memory

The Memory Schema page (route `/schema`, under the **EXPLORE** section of the sidebar) defines how Cognee extracts knowledge from a brain and rebuilds its memory. It shows a schema-view visualization alongside a config toolbar where you set the graph model, prompt, and ontology used during processing.

The graph-model, prompt, and ontology configuration — together with the **Re-process** action — were moved here from the [Mindmap](/cognee-cloud/ui/knowledge-graph) page, which is now focused on visualization only.

## Selecting a brain

A **BrainSelector** at the top chooses the active dataset (brain). The H1 reads **Memory Schema** and the subtitle shows **Define extraction rules and re-process to rebuild the memory for {brain}**.

The page renders a schema-view visualization embedded from `/v1/visualize` for the selected brain. Use the **Refresh** button to reload the visualization. Large graphs can take a while to render — the request waits up to **90 seconds** before timing out, so a slow load on a big graph is not misreported as a failure. The brain selector also picks up brains created outside the UI (for example by an agent session) on open, without a manual refresh.

If the selected brain has no schema yet, you see an empty state — **No memory schema yet** — with a **Go to Brains** button that takes you to the [Brains](/cognee-cloud/ui/datasets) page.

## Config toolbar

The config toolbar has three dropdowns — **Model**, **Prompt**, and **Ontology** — each defaulting to **Automatic**. Configuration is per brain (dataset) and is also editable from the brain detail page.

<Warning>
  Changing the model, prompt, or ontology when a brain already has files marks the brain **Outdated** until you **Re-process**. The new configuration applies on the next run, and the **Outdated** indicator appears on the [Brains](/cognee-cloud/ui/datasets) list and brain detail pages.
</Warning>

## Graph model

The **Model** dropdown selects the graph model that defines which entity types and relationships Cognee extracts:

* **Automatic** (default) — Cognee infers the schema from your data.
* A **saved model** — a model you previously created and named.

Each saved model offers an **Edit** option (opens the Graph Model editor) and a **Create new** option. Graph models are reached only from Memory Schema or a brain detail page — there is no **Graph Models** nav item.

### Graph Model editor

The Graph Model editor is the visual node editor for schemas. It has no dedicated sidebar entry — open it from the **Model** dropdown above (choose **Create new**, or **Edit** on a saved model) or from a brain detail page. It then opens full-screen at route `/graph-models/[id]`.

The editor is a visual canvas of entity types as draggable nodes: use **Add entity type** (top-left) to add a type, click a node to edit it, and drag to reposition. The right sidebar edits the selected type's **Name**, **Description**, and **Fields**.

Field and relation types are:

| Type       | Description                                                                           |
| ---------- | ------------------------------------------------------------------------------------- |
| `string`   | Text value.                                                                           |
| `number`   | Numeric value.                                                                        |
| `boolean`  | True/false value.                                                                     |
| `date`     | Date value.                                                                           |
| `relation` | A link to another entity; needs a target entity and a cardinality of `one` or `many`. |

The header shows a rename control, a **{n} types, {m} relationships** count, an **Unsaved** indicator, and **Delete**, **Regenerate**, and **Save** buttons. **Regenerate** analyzes the selected brain's files to propose a schema. (The same "infer from data" action is also available as **Infer from data** on the [brain detail page](/cognee-cloud/ui/datasets).)

## Custom prompt

The **Prompt** dropdown selects the extraction prompt:

* **Automatic** (default) — Cognee uses its built-in extraction prompt.
* A **named prompt** — a prompt you created.

**Create new** offers two starting points:

* **Generate from graph model** — seeds the prompt from a selected graph model (requires a selected model).
* **Start blank** — begins with an empty prompt.

Named prompts are editable and deletable.

## Ontology

The **Ontology** dropdown selects an optional OWL ontology to guide extraction:

* **Automatic** — no custom ontology.
* An **uploaded ontology** — an OWL file you provided.

Choose **Upload new** to add one. An upload needs a **Key**, an optional **Description**, and a `.owl` file.

## Re-process

Click **Re-process** to rebuild the brain's memory. This re-runs cognify with the chosen model, prompt, and ontology, and shows a **Re-processing started** notification. Re-process to clear the **Outdated** state after a config change.

## Related

<CardGroup cols={2}>
  <Card title="Configuration & Ontologies" icon="sliders" href="/cognee-cloud/functionality/configuration-and-ontologies">
    API equivalents for graph models, prompts, and ontologies.
  </Card>

  <Card title="Brains" icon="database" href="/cognee-cloud/ui/datasets">
    Edit per-brain config from the brain detail page.
  </Card>

  <Card title="Mindmap" icon="share-2" href="/cognee-cloud/ui/knowledge-graph">
    Visualize the memory the schema produces.
  </Card>
</CardGroup>
