# Remem Examples

`agentic-remem` has not been published to npm. Build it from the repository root:

```sh
npm ci
npm run build
```

`examples/opencode.json` uses the current OpenCode v2 beta configuration shape: the key is `plugins`,
and an entry is an object with `package` and `options`. Replace the placeholder file URL with the
absolute URL of this checkout's `dist` directory, then place the configuration where OpenCode loads
it and restart OpenCode.

The inline options use the read-only Markdown provider and `examples/memory/project-phoenix.md`.
Relative provider paths resolve from the OpenCode worktree, so run this example with the repository
as that worktree or adjust the path.

For managed PostgreSQL instead:

```sh
npm link
remem init --mode managed
remem doctor
```

Then remove `options` from the v2 plugin entry. With no inline `providers`, the plugin reads the
application configuration generated by `remem init`.

The package root, `dist/`, and `./opencode/v2` are current v2 entries. OpenCode `1.18.26`
compatibility is intentionally separate: use `./server` for the legacy `{ id, server }` module,
`./opencode/v1` for the direct adapter, or `dist/server.js` from this source build. The v1
`chat.message` boundary is weaker than v2's ephemeral context hook.

Neither example automatically writes OpenCode sessions to memory. PostgreSQL CRUD and supersession
are explicit library APIs through `PostgresMemoryProvider` and `MemoryManager`.
