# Your first memory

> Capture something worth remembering, then read it back.

With your agent [connected](/docs/connect), capturing memory is one statement.
There's nothing to groom by hand.

## Capture

Your agent writes what's worth remembering as it works:

```sql
insert into entries (content)
values ('The user prefers concise answers and dislikes hype.');
```

That's it. The entry lands in your personal workspace, attributed to you. No
`workspace_id` needed, no `author_id` to set — both default to you.

A fuller capture adds a title, a type, and a label or two:

```sql
insert into entries (title, content, entry_type)
values ('Tone preference', 'Prefers concise answers, dislikes hype.', 'decision')
returning id;

-- then tag it (one call upserts the tags and links them):
select apply_tags('entry', '<that-entry-id>', array['preferences', 'tone']);
```

See [Capturing memory](/docs/capturing) for entry types, projects, and tags.

## Retrieve

Later, the agent reads back what it needs. The raw log is always there:

```sql
select content from entries order by created_at desc limit 20;
```

But the better answer usually lives in the **wiki**, where the Dreamer has
already consolidated and cited things. Read pages first:

```sql
select title, summary from pages
where status = 'active'
  and fts @@ websearch_to_tsquery('english', 'tone preference');
```

Then follow links down to the source entries when you need provenance. See
[Organizing memory](/docs/organizing).

## The Dreamer

You don't organize memory yourself. The **Dreamer** runs nightly: it
consolidates entries into [pages](/docs/concepts), links what relates, and keeps
the whole thing tidy — so memory **compounds** instead of just piling up. See
[The Dreamer](/docs/dreamer).

> Nothing is mined, nothing is sold, and nothing is deleted behind your back.
