AI Generation
Answer (RAG)
Retrieve context from the store and generate an answer with the local LLM.
POST
Overview
Run retrieval-augmented generation (RAG) on the local store:- Search using the provided
query_vector(same dimension as the store). - Build a prompt from the top matching passages.
- Call Ollama on the host with fixed model
qwen2.5:0.5b-instruct.
threshold in kiosk mode), the server does not call the LLM and returns:
I don't have enough information to answer that question.
Requires Ollama running on the host. Start the stack with
moorcheh-edge up --with-llm (use --skip-ollama for search-only). The CLI and SDK embed query locally before calling this endpoint.Request body
string
required
Original question text (included in the LLM prompt and echoed in the response).
array
required
JSON array of floats used for similarity search. Length must match the store dimension (384 for text stores).
number
default:"5"
Number of passages to retrieve for context. Capped at 100.
number
default:"0"
Minimum search score when
kiosk_mode is true.boolean
default:"false"
When
true, filters retrieved passages below threshold.string
Optional system instruction (replaces the default RAG system prompt).
Optional instruction appended before the user question in the final user message.
array
Prior turns:
[{"role": "user"|"assistant", "content": "..."}].number
default:"0.2"
LLM sampling temperature (0.0–2.0).