# oap memory

> oap memory: Inspect and manage session memory entries. Every subcommand, flag, and example, generated from the CLI.

Source: https://openap.org/docs/oap-memory

Inspect and manage session memory entries

## `oap memory delete <session> <entry-id>`

Delete a memory entry

Flags:

```text
--confirm  Skip confirmation prompt
```

## `oap memory get <session> <entry-id>`

Show full detail for a single memory entry

Flags:

```text
--json  Output as JSON object
```

## `oap memory kinds <session>`

List registered memory kinds with entry counts

Flags:

```text
--json  Output as JSON
```

## `oap memory list <session>`

List memory entries for a session

Flags:

```text
--json             Output as JSON array
--kind string      Comma-separated kind filter (e.g. turn,label)
--limit int        Max entries to return (default "100")
--since string     Time filter: RFC3339 or relative duration (5m, 1h)
--tag stringSlice  Tag filter (repeatable, AND semantics)
--until string     Time filter: RFC3339 or relative duration (5m, 1h)
```

## `oap memory put <session>`

Write a memory entry. Input modes (mutually exclusive):
  - Pipe a full Entry JSON object via stdin
  - --file: read a full Entry JSON from a file
  - --kind + --content: construct an entry inline

The server forces scope from the URL and auto-generates the ID if empty.

Flags:

```text
--content string   JSON content string
--json             Output stored entry as JSON
--kind string      Entry kind (required with --content)
--tag stringSlice  Tags to set (repeatable)
-f, --file string  Path to a JSON file containing the entry
```

## `oap memory query <session>`

Query memory entries using link filters, field predicates, and all
the filters available in 'oap memory list'. Use --linked-to to find entries
that reference a specific entry, --field for content field equality.

Flags:

```text
--field stringSlice        Content field filter: path=val, path>val, path>=val, path<val, path<=val, path? (nil), path! (not nil)
--id stringSlice           Exact entry ID filter (repeatable)
--json                     Output as JSON array
--kind string              Comma-separated kind filter (e.g. turn,label)
--limit int                Max entries to return (default "100")
--linked-from stringSlice  Format: kind:id (repeatable)
--linked-to stringSlice    Format: kind:id (repeatable)
--since string             Time filter: RFC3339 or relative duration (5m, 1h)
--tag stringSlice          Tag filter (repeatable, AND semantics)
--until string             Time filter: RFC3339 or relative duration (5m, 1h)
```

## `oap memory reindex <session>`

Triggers a server-side reindex of all memory entries in the given
session into search providers. Use after adding a new search provider
to an existing deployment, or to recover from index corruption.

## `oap memory search <session>`

Search memory entries using natural language text, full-text search,
and vector similarity. Results are ranked by relevance score. Requires
search providers to be configured on the operator.

Use --text for natural language queries. Structured filters (--kind,
--tag, --field, --since, --until) pre-filter before ranking.

Flags:

```text
--field stringSlice  Content field filter: path=val, path>val, path>=val, path<val, path<=val, path? (nil), path! (not nil)
--json               Output as JSON
--kind string        Comma-separated kind filter (e.g. turn,label)
--limit int          Max results to return (default "20")
--since string       Time filter: RFC3339 or relative duration (5m, 1h)
--tag stringSlice    Tag filter (repeatable, AND semantics)
--text string        Natural language search query
--until string       Time filter: RFC3339 or relative duration (5m, 1h)
```

## `oap memory share <session> --with <other-session> [--with ...]`

Write SpiceDB relationships so that the started_by user of each
--with session gains 'interact' permission on the target session.
This enables query_memory cross-session reads for those sessions.

Example:
  oap memory share default/session-a --with default/session-b

This lets the user who started session-b read session-a's memory entries.
Use --revoke to remove the grant.

Flags:

```text
--revoke            Remove the grant instead of adding it
--with stringSlice  Session(s) whose started_by user gains read access (namespace/name, repeatable)
```
