# Memory & knowledge

> An agent remembers within reason: an authorized, searchable store with a knowledge-graph layer.

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

An agent with no memory is a goldfish with API keys. But the naive fixes each fail: stuffing the context
window doesn't scale, dumping turns to a blob isn't recallable, and bolting on a vector database ignores that
memory has *owners*. OAP gives an agent an **authorized, searchable store** with a
knowledge-graph layer — it remembers within reason.

[Video: The agent recalls from an authorized store, then produces and delivers a durable, versioned artifact.](https://openap.org/media/memory-demo.mp4)

## How it works

Memory is three layers: durable **storage**, ranked **search** (structured filters, full-text, and vector
similarity, fused and re-ranked), and a **knowledge-graph** layer that extracts entities and facts. Two kinds
of recall coexist: `query` is boolean filtering ("everything tagged X"), `search` is scoring ("what's most
relevant to this").

Every read and write is **authorized per subject** through the same SpiceDB graph as everything else — reading
is session membership, writing and deleting are the creator's — so memory isn't a shared bucket. And the
transcript, authorization decisions, and audit records are an **append-only, cryptographically signed,
tamper-evident log** you can verify offline. Durable *outputs* — rendered reports, pages, charts — are a
first-class thing of their own, with their own section: see [Artifacts](https://openap.org/docs/artifacts).

## Go deeper

- **[Storage, search & the knowledge graph](https://openap.org/docs/memory-storage-search)** — the three-layer stack and how recall works.
- **[Facts & observations](https://openap.org/docs/facts-observations)** — durable knowledge attached to resources, not just to a transcript.
- **[Per-subject authorization](https://openap.org/docs/memory-authorization)** — how the memory store is gated by the same graph as tools.
- **[The tamper-evident audit log](https://openap.org/docs/audit-log)** — append-only, signed records and `oap audit verify`.

> **Security: How this addresses the OWASP Agentic Top 10**
>
> - [ASI06 — Memory & Context Poisoning](https://openap.org/docs/owasp-top10#asi06) (partial): per-subject authorization, tenant/scope isolation, and a signed, tamper-evident audit log.
> - [ASI10 — Rogue Agents](https://openap.org/docs/owasp-top10#asi10) (partial): every authorization check writes a tamper-evident decision record that outlives the session — the audit system *is* the audit trail.
