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

# Memory

> Search OrgX organizational memory through governed REST tools.

OrgX memory includes decisions, artifacts, initiative context, project history,
and learned operating patterns. AI clients should use MCP memory tools by
default. REST clients can call the governed tool execution endpoint for approved
memory operations.

## Execute a Memory Tool

```http theme={"dark"}
POST /api/client/tools/execute
```

```bash theme={"dark"}
curl https://useorgx.com/api/client/tools/execute \
  -X POST \
  -H "Authorization: Bearer $ORGX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool_id": "orgx_search",
    "args": {
      "query": "deployment decisions",
      "limit": 5
    }
  }'
```

## Available Tool IDs

| Tool             | Description                                        |
| ---------------- | -------------------------------------------------- |
| `orgx_search`    | Search organizational memory and project context.  |
| `orgx_recommend` | Return a context-aware next action recommendation. |

Tool IDs may also be sent with the `chatgpt.` prefix. The API normalizes
`chatgpt.orgx_search` to `orgx_search`.

## Request Fields

| Field           | Type   | Required | Description                |
| --------------- | ------ | -------- | -------------------------- |
| `tool_id`       | string | Yes      | Allowed tool ID.           |
| `args`          | object | No       | Tool-specific arguments.   |
| `project_id`    | string | No       | Optional project scope.    |
| `initiative_id` | string | No       | Optional initiative scope. |
| `run_id`        | string | No       | Optional run scope.        |

## Response

```json theme={"dark"}
{
  "ok": true,
  "data": {
    "results": []
  },
  "tool_id": "orgx_search",
  "execution_time_ms": 42
}
```

## Errors

| Status | Meaning                                            |
| ------ | -------------------------------------------------- |
| `400`  | Missing `tool_id` or invalid JSON.                 |
| `401`  | API key authentication failed.                     |
| `403`  | Tool is not available through the client REST API. |

## MCP Equivalent

For AI clients, use:

* `orgx_search`
* `orgx_search`
* `orgx_recommend`
