---
description: Search Grounded memory (facts, sessions, docs) before asserting something
argument-hint: <question in plain words>
allowed-tools: Bash(curl:*), Bash(jq:*)
---
Search Grounded for: $ARGUMENTS

Grounded answers over HTTP at `$GROUNDED_URL` (default `http://127.0.0.1:7437`). If `GROUNDED_TOKEN` is set, the API wants `Authorization: Bearer $GROUNDED_TOKEN`; with no token configured the header is ignored.

1. Build the body with `jq` so the question is escaped, and POST it to `/recall`:

```bash
jq -n --arg q '<the question>' '{query: $q, limit: 10}' |
  curl -s -X POST "${GROUNDED_URL:-http://127.0.0.1:7437}/recall" \
    -H 'content-type: application/json' \
    -H "authorization: Bearer ${GROUNDED_TOKEN:-}" \
    --data-binary @-
```

2. Read the answer:
   - Cards are in `.data`, one list ranked by `score` across facts, sessions and docs. Each has `typedId`, `title`, `snippet`, `citation`.
   - Read `.meta` before concluding nothing matched: `meta.returned` is the honest count and `meta.truncated` says the limit cut it. `limit` is a total across all sources.
   - Cards are truncated on purpose. For the full record: `curl -s "${GROUNDED_URL:-http://127.0.0.1:7437}/get/<typedId>" -H "authorization: Bearer ${GROUNDED_TOKEN:-}"`.
   - Docs default to the `global` lane. To search another lane, add `"scopes": ["global", "<lane>"]`.

3. Answer with the cards that matter, each cited by its `typedId` or `citation`. If a card contradicts what you can observe, say so, name it by typed id and propose the fix.

If a call fails or a field is missing, read `GET /llms.txt` on the same base URL: it is the manual for the running instance.
