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

# Update

> Mutate graph state with RDF patches.

Autonomous agents write new facts into the graph to evolve the world. Worlds
supports multiple strategies for ingesting and synchronizing knowledge within a
stateful context.

## State mutations

A world mutates its state using RDF patches, which are additions and deletions
of facts. Because Worlds is a chronological, append-only ledger, these patches
permanently preserve historical truth.

### Import quads

The mutation path on the hosted API is the [import endpoint](/console/import).
[SPARQL](/worlds/query) on the data plane is read-only; to change state, send
quads to import:

```bash theme={null}
curl -s -X POST "https://worlds-api.wazoo.dev/worlds/my-world-id/import" \
  -H "Authorization: Bearer $WORLDS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contentType": "application/json",
    "data": "[{\"subject\":\"urn:wazoo:worlds\",\"predicate\":\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\",\"object\":\"https://schema.org/SoftwareApplication\"}]"
  }'
```

The import above asserts that `wazoo:worlds` is a `schema:SoftwareApplication`.
Set `contentType` to `text/plain` to ingest unstructured text chunks instead.

Unlike traditional databases that overwrite records, Worlds uses RDF patches to
keep a chronological record of changes.

## Mutation and state

Every update to a world is a transaction that appends new facts to the ledger.
This ensures agents can always query past states and see how information has
changed.

### RDF patches

An RDF patch is a structured set of additions and deletions. When you update a
relationship, the engine performs a patch:

1. Deletion: Remove the outdated triple.
2. Addition: Insert the new, verified triple.

This process is atomic and verifiable.

## Update strategies

Worlds supports multiple methods for mutating state, depending on the required
precision and automation level.

| Method       | Use case                                         |
| :----------- | :----------------------------------------------- |
| Import quads | Assert structured facts as RDF quads             |
| Import text  | Ingest unstructured text as searchable chunks    |
| RDF patches  | Delta-based synchronization from external stores |

## Feedback ingestion

Intentional agency requires a bridge between human preferences and graph state.
RLHF enables this by treating feedback as a first-class mutation.

### Capturing rewards

When a user or supervisor provides feedback (e.g., a thumbs up or a specific
correction), the API records this as a preference item connected to the original
fact.

```bash theme={null}
curl -s -X POST "https://worlds-api.wazoo.dev/worlds/my-world-id/import" \
  -H "Authorization: Bearer $WORLDS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contentType": "application/json",
    "data": "[{\"subject\":\"urn:fact:123\",\"predicate\":\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\",\"object\":\"https://schema.wazoo.dev#Preference\"},{\"subject\":\"urn:fact:123\",\"predicate\":\"https://schema.wazoo.dev#hasReward\",\"object\":\"1.0\"}]"
  }'
```

## Recursive learning

As preferences accumulate, the world's probability landscape is reshaped.
Historical reward signals boost retrieval results, which creates a recursive
loop where the system learns which triples are most useful or truthful for the
agent's context.

This historical truth remains in the ledger, so this preference data can guide
future queries. Learn more about
[preference-aware retrieval](/worlds/query#preference-aware-retrieval).
