answer
Retrieve AI-generated answers by searching your namespace of text documents or using direct AI model calls for question answering.
Instructions
Get AI-generated answers based on data in a namespace using text queries. This tool provides intelligent, context-aware responses by searching through your stored text documents and generating comprehensive answers using advanced language models. Supports two modes: Search Mode (with namespace) and Direct AI Mode (empty namespace).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | Namespace to answer questions from. For Search Mode: provide a text namespace containing documents to search for context. For Direct AI Mode: provide empty string "" to make direct AI model calls without searching your data. | |
| query | Yes | Text query for AI answer generation. Provide a natural language question or prompt that you want the AI to answer. The AI will search through your namespace content and generate a comprehensive response based on the relevant information found. | |
| top_k | No | Number of top results to return. Controls how many relevant documents the AI considers when generating an answer. Default is 10. Use lower values (3-5) for focused answers, higher values (8-10) for comprehensive responses that consider more context. | |
| type | No | Search type for answer generation. Supported value is 'text'. | |
| threshold | No | Similarity threshold for results. A value between 0 and 1 that filters documents based on relevance before generating the answer. Higher values (0.7-0.9) ensure only highly relevant content is used, lower values (0.3-0.5) include more context. Required when kiosk_mode is true. | |
| kiosk_mode | No | Kiosk mode for restricted search. When true, search is restricted to specific namespaces with threshold filtering, providing more controlled and focused answers suitable for production environments. | |
| ai_model | No | AI model ID for answer generation (snake_case field sent to the API). Supported models: 'anthropic.claude-sonnet-4-6' (Claude Sonnet 4.6), 'anthropic.claude-opus-4-6-v1' (Claude Opus 4.6), 'meta.llama4-maverick-17b-instruct-v1:0' (Llama 4 Maverick 17B), 'amazon.nova-pro-v1:0' (Amazon Nova Pro), 'deepseek.r1-v1:0' (DeepSeek R1), 'deepseek.v3.2' (DeepSeek V3.2), 'openai.gpt-oss-120b-1:0' (OpenAI GPT OSS 120B), 'qwen.qwen3-32b-v1:0' (Qwen 3 32B), 'qwen.qwen3-next-80b-a3b' (Qwen3 Next 80B A3B). If omitted, the Moorcheh API uses its default model for your account. | |
| chat_history | No | Chat history for AI answer generation. Provide previous conversation context to help the AI maintain continuity and reference earlier parts of the conversation. This enables more coherent multi-turn conversations. | |
| header_prompt | No | Header prompt for AI answer generation. Custom instructions that define the AI's role, style, and behavior. Use this to create specialized assistants (e.g., technical support, friendly helper, formal advisor) or set specific guidelines for response generation. | |
| footer_prompt | No | Footer prompt for AI answer generation. Additional instructions that are applied after the main response generation. Useful for formatting requirements, citation styles, or specific response patterns that should be consistently applied. | |
| temperature | No | Temperature for AI answer generation. Controls the creativity and randomness of responses. Lower values (0.1-0.3) produce more focused, deterministic answers. Higher values (0.7-1.0) produce more creative, varied responses. Default is 0.7. |