Skip to main content

Overview

The voice server is started with moorcheh-edge voice serve. It runs on Linux edge hardware (for example Arduino UNO Q) and exposes mic, speaker, and RAG endpoints over HTTP. It is not part of the Moorcheh Edge Docker container (:8080). RAG calls are proxied to Moorcheh Edge on the same device (default http://127.0.0.1:8080).
Run moorcheh-edge voice setup once before starting the server.

GET /health

Check that the voice server is running.

POST /listen

Record from the device mic and return transcribed text.
seconds
number
Fixed recording length in seconds. When set, disables silence detection.
until_silence
boolean
default:"true"
When true (and seconds is omitted), stop recording after a pause in speech.
max_seconds
number
default:"30"
Maximum recording length when using silence detection (3–60).

POST /speak

Synthesize and play text on the device speaker.
text
string
required
Text to speak.

POST /ask/stream

Stream a RAG answer as Server-Sent Events. Embeds the query on the edge device when query_vector is omitted; otherwise uses the vector you supply. Proxies POST /answer/stream on Moorcheh Edge. When speak: true, streams answer tokens to the remote UI immediately and starts TTS after the full answer is ready (one Piper pass on the device speaker).
query
string
required
Question text.
query_vector
array
Optional precomputed embedding. When omitted, the server embeds locally with BGE-small-en-v1.5 (384-dim).
top_k
number
default:"5"
Passages to retrieve for context.
kiosk_mode
boolean
default:"true"
When true, filters passages below threshold.
threshold
number
default:"0.25"
Minimum search score when kiosk_mode is true.
header_prompt
string
Optional system instruction for RAG.
Optional instruction before the question.
chat_history
array
Prior turns: [{"role": "user"|"assistant", "content": "..."}].
speak
boolean
default:"false"
When true, speak the full answer on the device after streaming completes.
holding_enabled
boolean
default:"true"
When speak is true, play the cached kiosk holding welcome audio in parallel with RAG. Pre-generate with moorcheh-edge voice cache-holding - see Retail Kiosk: kiosk audio cache.
thinking_enabled
boolean
default:"true"
When speak is true, loop the ambient thinking WAV until answer tokens arrive (after holding). Pre-generate with moorcheh-edge voice cache-thinking - see Retail Kiosk: kiosk audio cache. Disable globally with MOORCHEH_THINKING_SOUND=0.

SSE events

Inherits Moorcheh Edge events from Answer stream: Additional events when speak: true: TTS continues in the background after the HTTP stream closes; the connection does not wait for playback to finish.

POST /ask and POST /ask/voice

Full voice loop: record from mic (unless query is provided), embed locally, call POST /answer on Moorcheh Edge, and speak the reply on the device. /ask/voice is an alias for /ask.
query
string
When set, skip mic capture and use this text as the question.
seconds
number
Fixed recording length when query is omitted.
until_silence
boolean
default:"true"
Stop recording after a pause when seconds is omitted.
max_seconds
number
default:"30"
Maximum recording length for silence detection.
top_k
number
default:"5"
Passages to retrieve for context.
kiosk_mode
boolean
default:"true"
Filter low-scoring passages when true.
threshold
number
default:"0.25"
Minimum score when kiosk_mode is true.
header_prompt
string
Optional system instruction.
Optional instruction before the question.
chat_history
array
Prior conversation turns.
speak
boolean
default:"true"
When true, play the answer on the device speaker.

POST /catalog/document

Chunk a catalog document, embed on the device, and upload vectors to Moorcheh Edge on the same board. Used by the retail kiosk Admin when saving documents (MOORCHEH_VOICE_PROXY_URL).
doc_id
string
required
Stable document id (used in chunk ids and [meta] headers).
category
string
required
Document category (e.g. menu, policy).
title
string
required
Display title for the document.
text
string
required
Full document body to chunk and embed. Alias: body.
tags
array | string
Tags as a JSON array or comma-separated string.
orphan_chunk_ids
array
Edge item ids to delete before upload (replaced chunks after an edit). Alias: orphan_ids.

Errors