---
title: "Agent memory"
method: POST
path: "/v1/memory"
tags: ["Agent memory"]
---

# Agent memory

`POST /v1/memory`

## Request

- Base URL: `https://api.thecompound.tech`
- URL: `https://api.thecompound.tech/v1/memory`
- Auth: HTTP bearer

ParseRail stores, searches, and forgets memories for your agents in your own namespace. It provides semantic recall without a vector DB to run.

Cost: 2 credits ($0.02) — charged only on success.

## Headers

- `ParseRail-Dry-Run` '1' | 'true'
- `Idempotency-Key` string

## Request body

- object
  - `op` 'store' | 'search' | 'forget', required: The operation.
  - `namespace` string: Provide your partition key, such as an agent id or a user id. It defaults to "default".
  - `content` string: store: the memory text.
  - `metadata` object: For store:, provide attached metadata; recall returns it.
  - `query` string: search: what to recall.
  - `limit` integer: search: max results.
  - `id` string: For forget:, provide the memory id, or omit it with namespace to wipe it.

## Response `200`

The call succeeded. The response contains result fields and a usage envelope. With `ParseRail-Dry-Run: 1` the body is a DryRun object instead.

- union
  - object
    - `op` 'store' | 'search' | 'forget', required
    - `id` string, nullable: store: the new memory's id.
    - `results` object[]: search: the recalled memories.
      - `id` string, required
      - `content` string, required
      - `score` number, required: Semantic similarity 0–1.
      - `metadata` object
      - `createdAt` string
    - `deleted` integer, nullable: forget: how many were removed.
    - `usage` Usage, required
      - `credits` integer, required: Credits burned by this call.
      - `balanceRemaining` integer, required: Wallet balance after the charge.
  - DryRun: A dry run: auth, the per-key throttle, body validation and the balance precheck ran. No model ran and nothing was charged.
    - `dryRun` true, required
    - `valid` true, required: The body passed validation. An invalid body returns 400 instead.
    - `endpoint` string, required
    - `wouldCharge` integer, required: Credits a successful live call would charge.
    - `balance` integer, required: Your wallet balance now.
    - `liveStatus` 200 | 202 | 402, required: The status a live call with this body would get: 402 when the balance or the key's monthly cap cannot cover it, 202 for `async: true`, else 200.
    - `keyCapRemaining` integer: Present when the key carries a monthly cap: credits left under it this month.
    - `usage` Usage, required
      - `credits` integer, required: Credits burned by this call.
      - `balanceRemaining` integer, required: Wallet balance after the charge.
    - `requestId` string, required

## Other responses

- `400`: Invalid request body.
- `401`: Missing or invalid API key.
- `402`: `insufficient_credits`: the balance cannot cover the call. `spend_cap_reached`: the key has reached its monthly cap. Nothing is charged.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/thecompound/apis/parserail.md) · [All operations](https://skmtc.dev/thecompound/apis/parserail/llms.txt) · [OpenAPI document](https://skmtc.dev/thecompound/apis/parserail/revisions/7895a3b7812b?raw)
