---
title: "List memory blocks."
method: GET
path: "/memory_blocks"
tags: ["Memory Blocks"]
---

# List memory blocks.

`GET /memory_blocks`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/memory_blocks`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/memory_blocks/get.ts> (a function with typed inputs; its response is checked against the schema)

List memory blocks accessible to the current user (owned, shared, or public).

## Query parameters

- `offset` integer
- `limit` integer
- `name_filter` string
- `updated_after` string, date-time

## Response `200`

Successful operation

- object
  - `items` MemoryBlock[], required
    - `id` string, required: Unique identifier of the memory block.
    - `name` string, required: Name of the memory block.
    - `content` string, required: Text content of the memory block.
    - `system_prompt_amendment` string, required: System prompt amendment for agent mode.
    - `injection_mode` 'system_prompt' | 'user_instruction' | 'agent_file' | 'agent_tool', required: Where memory content is injected. 'system_prompt' adds it to the LLM system prompt; 'user_instruction' prepends it to the user message; 'agent_file' makes it only available as AGENTS.md in agent mode; 'agent_tool' exposes content lazily via the read_memory_block / update_memory_block tools (no pre-injection).
    - `access_mode` 'read' | 'write' | 'read_write', required: Controls whether the LLM/agent can read the memory, write to it, or both.
    - `user_id` string, required: ID of the user who owns the memory block.
    - `username` string: Username of the owner.
    - `created_at` string, date-time, required: When the memory block was created.
    - `updated_at` string, date-time, required: When the memory block was last updated.
    - `is_public` boolean: Whether the memory block is publicly accessible.
    - `is_owner` boolean: Whether the current user is the owner.
    - `max_content_length` integer: Maximum number of characters allowed in memory content. 0 means unlimited.
    - `is_auto` boolean: Whether this memory block was auto-created by the system for an AI assistant or chat session.
    - `user_count` integer: The number of users the memory block has been directly shared with (excludes the owner).
    - `group_count` integer: The number of groups the memory block has been shared with.
  - `total` integer, required: Total number of accessible memory blocks matching the filters.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
