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

# answer

> A concise, cited answer grounded only in the knowledge base.

`answer` composes a short answer to a clinical question — grounded **only** in
the indexed recommendations, with citations.

**Endpoint:** `POST /v1/answer` · **MCP tool:** `answer`

## Pipeline

```
find sources → select the most relevant → compose a cited answer
```

When no source covers the question, `answer` returns a fixed sentence stating the
information is not in the indexed recommendations — it does not invent.

## Request

| Field        | Type   | Notes                                             |
| ------------ | ------ | ------------------------------------------------- |
| `query`      | string | Free-text clinical question (French).             |
| `source_ids` | int\[] | Optional. Restrict retrieval to specific sources. |

## Response

```json theme={null}
{
  "query": "Quelle antibioprophylaxie pour une chirurgie colorectale ?",
  "reformulated_question": "Antibioprophylaxie recommandée en chirurgie colorectale",
  "answer": "Céfazoline en dose unique préopératoire...",
  "sources": [
    {
      "reco_id": 900,
      "reco_title": "Chirurgie colorectale",
      "source_name": "SFAR",
      "deep_link": "https://.../14853.pdf"
    }
  ],
  "tokens_in": 1200,
  "tokens_out": 90
}
```

<Note>
  Citations are a **separate array** (no inline markers). Each entry is a
  recommendation actually used, deduplicated, with its `deep_link`.
</Note>

Run it live in the **API Reference** tab.
