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
Original question text (included in the LLM prompt and echoed in the response).
JSON array of floats used for similarity search. Length must match the store dimension (768 for text stores).
Number of passages to retrieve for context. Capped at 100.
Minimum search score when
kiosk_mode is true.When
true, filters retrieved passages below threshold.Optional system instruction (replaces the default RAG system prompt).
Optional instruction appended before the user question in the final user message.
Prior turns:
[{"role": "user"|"assistant", "content": "..."}].LLM sampling temperature (0.0–2.0).