> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcdn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Library Memory

> Cited summary pages of your library, of each video, and of each topic, person, product and place your videos cover.

Library Memory is a set of summary pages that AgentTV writes from your videos. Each line on a page cites the video moment it comes from. You read the pages in the console. AI apps read them through MCP. Your team reads them through the API.

## The pages

| Page | What it holds | When it exists |
| - | - | - |
| **Library** | An index of the topics, people, products and places your videos cover, with the videos behind each | Once your videos share at least one topic or person |
| **Video** | A summary, chapters, steps, key points, the people, products and places in the video, and text shown on screen | For each live video |
| **Topic** | A summary, key points with quotes, questions the videos answer, where your videos differ, how a speaker's view changed over time, people, and videos | When at least 2 of your videos cover the topic |
| **Person** | What the person says and where they appear, who they appear with or interview, where the videos differ, and their views over time | When a video names the person |
| **Product** or **Place** | The videos it is in, and how it appears in each | When at least 2 of your videos show or name it |

Topic, person, product and place pages are one kind in the API and MCP: `entity` for people, products and places, `topic` for topics.

A few line types need explaining:

* **Key point.** A statement from a video with its exact words as a quote. If the quote cannot be shown, the line is not shown.
* **Where your videos differ.** Two moments from two different videos that conflict, with one plain sentence on the conflict.
* **Views over time.** What one named speaker said on one topic, in the order they said it, with the date. Each later point is marked as said again, refined, or changed view. This needs points at least 180 days apart, from videos with a reliable publish date.

## Where you see it

### In the console

Open **Memory** in the console sidebar. The page reads "What your videos cover, each line cited to the moment."

* **Highlights** at the top: for example, the topic your videos cover most, or questions viewers asked that got no answer.
* Tabs for **Topics**, **People**, **Products** and **Places**, with one search box: **Search topics, people, products, places**.
* Open a card for its page. Topic and person pages have **Key points**, **Questions answered**, **Where your videos differ**, **Views over time**, **People**, **Videos** and **Connections** (other subjects that share videos with this one). Each cited moment plays in the player beside the page.
* If you turned on YouTube Analytics, library, topic and entity pages also show **On YouTube**. Only you see it.

With only one video, or before processing ends, the page shows **Memory grows as you add videos** and lists your videos instead.

A video's own page is in **Videos**. Open a video: its key points are on the **Chapters** tab, and the people, products and places are on **In this video**.

Links you can share inside your team:

* `https://app.agentcdn.com/memory?topic=TOPIC_ID` opens a topic page.
* `https://app.agentcdn.com/memory?entity=ENTITY_ID` opens a person, product or place page.
* Add `&v=vid_123&t=95` to play that video at 95 seconds when the page opens.

### In AI apps through your public MCP

Your public library MCP has a `get_memory_page` tool. See [Connect an MCP](https://docs.agentcdn.com/guides/connect-mcp.md) for the URL, for example `https://mcp.agentcdn.com/c/your-brand/mcp`. Your own ChatGPT app has the same tool (see [Publish your own app in ChatGPT](https://docs.agentcdn.com/guides/your-ai-app.md)).

| Argument | Value |
| - | - |
| `kind` | `library` (default), `video`, `topic` or `entity` |
| `subject` | For `video`, a `video_id` from `search_videos`. For `topic` or `entity`, the `topic_id` or `entity_id` from the `refs` of a line on another page. Leave it out for `library`. |

A good flow for an agent: read the `library` page, pick a topic or person from its `refs`, read that page, then read a cited moment with `get_moment_context`.

```json theme={null}
{
  "found": true,
  "kind": "topic",
  "subject": "TOPIC_ID",
  "title": "Battery life",
  "sections": [
    {
      "section": "point",
      "lines": [
        {
          "text": "Turning off the always-on display adds about a day of battery.",
          "quote": { "text": "Turn off always-on and you get a full extra day.", "start_ms": 312000, "end_ms": 316500 },
          "citations": [
            { "video_id": "vid_123", "start_ms": 309000, "end_ms": 331000, "start_time": 309, "end_time": 331 }
          ],
          "refs": { "topic_id": "TOPIC_ID" }
        }
      ]
    }
  ]
}
```

If there is no page, `found` is `false` with `reason: "page_not_found"`. The agent should then use `search_videos`.

The public tool shows only your public videos, under the rights you set for AI use. It never returns the owner-only YouTube block.

### Through your account: API and account MCP

You can read the same pages as the owner, including unlisted and private videos.

* **Account MCP:** the `get_memory_page` tool. Setup: [Account MCP](https://docs.agentcdn.com/guides/connect-mcp.md#account-mcp).
* **API:** `GET /v1/memory`. Create a key at [API keys](https://docs.agentcdn.com/api-keys.md).

```bash theme={null}
curl "https://api.agentcdn.com/v1/memory?kind=topic&subject=TOPIC_ID" \
  -H "Authorization: Bearer $AGENTCDN_API_KEY"
```

`kind` is `library`, `video`, `topic` or `entity`. Every kind except `library` needs `subject`: a video id for `video`, or the `topic_id` or `entity_id` from the `refs` of a line for the others. The response groups lines by section. Topic and entity pages also return `title`, `video_count` and `neighbors`. The library page returns `section_totals`, the real count of each section. Full schema: [API reference](https://docs.agentcdn.com/api-reference/overview.md).

## How it stays current

* **Pages rebuild when your videos change.** Adding, changing, removing or restoring a video queues its video page. Topic, person, product and place pages rebuild when the videos they read change. The library page rebuilds after them.
* **A page is rewritten only when its inputs change.** An unchanged page is not built again.
* **The old page stays up until the new one is ready.** You never see an empty page during a rebuild.
* **Every read is checked again.** Each time a page is read, AgentTV checks every citation against the video's current state: live, in scope, visible to this reader, and allowed by your current rights. A citation that fails is dropped. A line with no citation left is dropped. So a video you remove or make private leaves your public pages at once, before any rebuild.
* **Quotes follow your quote limit.** If your rights limit how long a quote may be, a quote outside that window is withheld. A key point without its quote is not shown.

## How citations work

Every line cites at least one moment. A citation is a video and a time range:

| Field | Meaning |
| - | - |
| `video_id` | The cited video |
| `start_ms`, `end_ms` | The range, in milliseconds |
| `start_time`, `end_time` | The same range in seconds (MCP only). Pass these to `get_moment_context` to read the words and shots behind the line. |

A line cites at most 3 moments. A "where your videos differ" line always cites exactly 2, from 2 different videos.

> [!NOTE]
>
> Pages hold text and citations only. They never contain a stream URL or a media link. To play a moment, an agent calls `get_video_stream`, which applies your rights and playback rules.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.