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

# Query: Strongest Path

> Find the path with the highest total weight between two nodes.

<ParamField path="method" type="POST">
  `/query`
</ParamField>

**Authentication:** Required (if enabled)

Uses DFS with backtracking to find the simple path with maximum total weight between two nodes, correctly handling all graph topologies including cycles.

<Note>
  The search is bounded: it stops at depth 100 or after 50,000 node visits, whichever
  comes first, and returns the strongest path found within those bounds. On dense graphs
  that path may not be the strongest one overall.
</Note>

## Request

```json theme={null}
{
  "type": "strongest_path",
  "start": 0,
  "end": 5
}
```

| Field   | Type          | Required | Description                 |
| ------- | ------------- | -------- | --------------------------- |
| `type`  | string        | Yes      | Must be `"strongest_path"`. |
| `start` | integer (u64) | Yes      | Starting node ID.           |
| `end`   | integer (u64) | Yes      | Target node ID.             |

## Response

<CodeGroup>
  ```json 200 OK (found) theme={null}
  {
    "success": true,
    "found": true,
    "path": [0, 3, 5],
    "edges": [
      {"from": 0, "to": 3, "weight": 15},
      {"from": 3, "to": 5, "weight": 12}
    ],
    "grounding": "inference",
    "error": null
  }
  ```

  ```json Not Found theme={null}
  {
    "success": true,
    "found": false,
    "path": [],
    "edges": [],
    "grounding": "unknown",
    "error": null,
    "diagnostic": "no_path"
  }
  ```
</CodeGroup>

When `found` is `false`, `diagnostic` explains why: `start_not_found`, `end_not_found`, or `no_path` (both nodes exist but no path connects them).

## Example

```bash theme={null}
curl -X POST http://localhost:8080/query \
     -H "Content-Type: application/json" \
     -d '{"type": "strongest_path", "start": 0, "end": 5}'
```
