# `SuperPi.Durable.Schemas.Memory`
[🔗](https://github.com/oleksandr/super-pi-beam/blob/v0.1.0/lib/super_pi/durable/schemas/memory.ex#L1)

A durable note of the Memory plugin (`memories` table).

A note belongs to a scope `(scope_kind, scope_id)`: `owner` (the principal that owns the
conversation, the default) or `global`. It does not belong to a conversation. Notes are not forked
and not rewound, so `origin_conversation_id` is a plain integer, deliberately not a foreign key,
and deleting a conversation never deletes knowledge. `created_seq`, `origin_conversation_id` and
`origin_entry_seq` keep an as-of view possible later.

`topics` is a space-separated string of normalized words (see `SuperPi.Memory.normalize_topics/1`),
so one text column feeds the lexical index. `superseded_by_id` marks a corrected note: it stays
readable and ranks below the note that replaced it.

The lexical index (`memories_fts` on SQLite, the generated `search` column on PostgreSQL) is not a
field here. The database keeps it in step with the row.

# `t`

```elixir
@type t() :: %SuperPi.Durable.Schemas.Memory{
  __meta__: term(),
  body: term(),
  confidence: term(),
  created_seq: term(),
  id: term(),
  inserted_at: term(),
  origin_conversation_id: term(),
  origin_entry_seq: term(),
  pinned: term(),
  provenance: term(),
  scope_id: term(),
  scope_kind: term(),
  slug: term(),
  source: term(),
  superseded_by_id: term(),
  title: term(),
  topics: term(),
  updated_at: term(),
  updated_seq: term()
}
```

# `changeset`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
