---
title: "Retrieve what a mind knows about a query"
description: "Everything this mind holds that bears on the query: matched skills,\nremembered facts, and document excerpts.\n\n**This endpoint does not generate text.** All three arms are existing\nnon-generative retrievers, scoped to the mind. The caller does the\nreasoning — which is the point, since a model is usually already sitting on\nthe other side of this call.\n\nArms fail independently: a dead embedder costs you skills and excerpts, not\nthe memories you could still have had."
---

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

Path: AI Gateway API › Minds

`POST /minds/{mind_id}/consult`

Everything this mind holds that bears on the query: matched skills,
remembered facts, and document excerpts.

**This endpoint does not generate text.** All three arms are existing
non-generative retrievers, scoped to the mind. The caller does the
reasoning — which is the point, since a model is usually already sitting on
the other side of this call.

Arms fail independently: a dead embedder costs you skills and excerpts, not
the memories you could still have had.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `mind_id` (`consult.path.mind_id`; string, required)
  - format `uuid`

## Header parameters

- `X-App-Id` (`consult.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`
- `X-On-Behalf-Of` (`consult.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`consult.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`

## Request body

_Required._

- `query` (`consult.query`; string, required) — What to retrieve. Skills are matched against this by embedding similarity, so keep the asker's own wording.
  - minLength 1; maxLength 5000
- `agent_id` (`consult.agent_id`; string, optional) — Memory scope for the caller's own facts, blended alongside the mind's.
  - default `"chatbot"`

## Example request

```json
{
  "query": "string",
  "agent_id": "chatbot"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://truememory-api.mvstg.com/minds/<mind_id>/consult' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "string",
  "agent_id": "chatbot"
}
'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/minds/<mind_id>/consult';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({query: 'string', agent_id: 'chatbot'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/minds/<mind_id>/consult"

payload = {
    "query": "string",
    "agent_id": "chatbot"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "mind_id": "string",
  "mind": "string",
  "query": "string",
  "skills": [
    {
      "key": "string",
      "name": "string",
      "instructions": "string",
      "similarity": 0,
      "files": [
        {
          "path": "string",
          "size": 0
        }
      ]
    }
  ],
  "memories": [
    {
      "fact": "string",
      "when": "string",
      "source": "string",
      "scope": "string"
    }
  ],
  "excerpts": [
    {
      "filename": "string",
      "content": "string"
    }
  ]
}
```

- `mind_id` (`consult.response.200.mind_id`; string, required)
- `mind` (`consult.response.200.mind`; string, required)
- `query` (`consult.response.200.query`; string, required)
- `skills` (`consult.response.200.skills`; array<object>, optional)
  - `key` (`consult.response.200.skills.key`; string, required)
  - `name` (`consult.response.200.skills.name`; string, required)
  - `instructions` (`consult.response.200.skills.instructions`; string, required)
  - `similarity` (`consult.response.200.skills.similarity`; number, required)
  - `files` (`consult.response.200.skills.files`; array<object>, optional) — The skill's other files. Read one with GET /minds/{mind_id}/skills/{key}/files/{path} when the instructions point to it.
    - `path` (`consult.response.200.skills.files.path`; string, required)
    - `size` (`consult.response.200.skills.files.size`; integer, required)
- `memories` (`consult.response.200.memories`; array<object>, optional)
  - `fact` (`consult.response.200.memories.fact`; string, required)
  - `when` (`consult.response.200.memories.when`; any of, optional)
    - any of: `string`, `null`
  - `source` (`consult.response.200.memories.source`; any of, optional)
    - any of: `string`, `null`
  - `scope` (`consult.response.200.memories.scope`; any of, optional)
    - any of: `string`, `null`
- `excerpts` (`consult.response.200.excerpts`; array<object>, optional)
  - `filename` (`consult.response.200.excerpts.filename`; string, required)
  - `content` (`consult.response.200.excerpts.content`; string, required)

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`consult.response.422.detail`; array<object>, optional)
  - `loc` (`consult.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`consult.response.422.detail.msg`; string, required)
  - `type` (`consult.response.422.detail.type`; string, required)
  - `input` (`consult.response.422.detail.input`; unknown, optional)
  - `ctx` (`consult.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/minds/consult/index.md
