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

# moorcheh-edge answer

> RAG: search the store and generate an answer with the local LLM.

## Synopsis

```bash theme={null}
moorcheh-edge answer --query TEXT [options]
```

Embeds **`--query`** locally (BGE-small-en-v1.5, 384-dim), searches the store, and calls **`POST /answer`**. The server uses Ollama with fixed model **`qwen2.5:0.5b-instruct`**.

When search returns **no passages** (empty store or `--kiosk-mode` + `--threshold` filters everything), the server skips the LLM and returns:

`I don't have enough information to answer that question.`

<Note>
  Run `moorcheh-edge up` first so Ollama is installed and the LLM model is pulled. Use `--skip-ollama` on `up` only if you want search without RAG.
</Note>

## Options

| Flag                  | Default                 | Description                              |
| --------------------- | ----------------------- | ---------------------------------------- |
| `--query`             | Required                | Question to answer                       |
| `--top-k`             | `5`                     | Passages to retrieve for context         |
| `--threshold`         | `0.0`                   | Minimum score when `--kiosk-mode` is set |
| `--kiosk-mode`        | off                     | Filter low-scoring passages              |
| `--header-prompt`     | -                       | Custom system instruction                |
| `--footer-prompt`     | -                       | Instruction before the question          |
| `--chat-history-json` | -                       | Prior turns as JSON array                |
| `--temperature`       | `0.2` (server)          | LLM temperature 0.0–2.0                  |
| `--timeout`           | `120`                   | HTTP timeout in seconds                  |
| `--base-url`          | `http://localhost:8080` | API base URL                             |

## Examples

```bash theme={null}
moorcheh-edge upload-documents --documents-file documents.json
moorcheh-edge answer --query "Who won the football match?" --top-k 5 --kiosk-mode --threshold 0.8
```

Off-catalog question (no matching chunks):

```bash theme={null}
moorcheh-edge answer --query "What is the weather on Mars?" --kiosk-mode --threshold 0.8
```

With custom temperature and longer timeout (useful on edge hardware):

```bash theme={null}
moorcheh-edge answer --query "Who won?" --top-k 5 --temperature 0.1 --timeout 300
```

## Output

Prints JSON to stdout:

```json theme={null}
{
  "answer": "...",
  "model": "qwen2.5:0.5b-instruct",
  "query": "Who won the football match?",
  "context_count": 1,
  "sources": [...]
}
```

See [API: Answer](/api-references/answer).
