Question Answering
Question Answering turns your store into an AI-powered knowledge base.
Instead of returning raw content like search, it generates complete answers based on the retrieved context.
Basic Question Answering
Ask questions and get augmented answers based on your Store content:
from mixedbread import Mixedbread
mxbai = Mixedbread(api_key="YOUR_API_KEY")
response = mxbai.stores.question_answering(
store_identifiers=["my-knowledge-base"],
query="What are the main features of the product?",
top_k=5,
instructions=(
"Answer for an API evaluator. Use concise bullets and cite the most relevant sources."
),
qa_options={"cite": True, "multimodal": True},
)
print(response)Multimodal support enables:
- Image understanding: Answers based on diagrams, charts, and visuals
- OCR text: Extracted text from images contributes to answers
Pass instructions when you want to control answer style, scope, or formatting.
Typical uses include enforcing concise bullet points, prioritizing specific facts,
or asking the model to cite only the strongest supporting passages.
Defaults and configuration
By default, Question Answering uses citations and multimodal context.
To change behavior, pass qa_options explicitly.
from mixedbread import Mixedbread
mxbai = Mixedbread(api_key="YOUR_API_KEY")
response = mxbai.stores.question_answering(
store_identifiers=["my-knowledge-base"],
query="What were the key decisions made last quarter?",
top_k=5,
qa_options={"cite": False, "multimodal": False},
)
print(response)Example Response
{
"answer": "Based on the provided source, the key decision made last quarter involved finalizing the budget for Project Alpha <cite i=\"0\"/>.",
"sources": [
{
"chunk_index": 2,
"mime_type": "text/plain",
"model": "mxbai-omni",
"score": 0.92,
"file_id": "your_file_id_1",
"filename": "meeting_notes_q1.docx",
"store_id": "{{STORE_ID}}",
"metadata": {},
"type": "text",
"text": "In the Q1 board meeting, we agreed to finalize the budget for Project Alpha with a total allocation of $2.5M..."
}
]
}- Answer: AI-generated answer. May include citation tags like
<cite i="0"/>. - Sources: Context used for the answer. Each entry includes:
chunk_index,score,file_id,filename- Content fields:
text,image_url, with optionalocr_text - Use indices from
<cite i="n"/>to map tosources[n]
Inspecting requests
Every Question Answering request is recorded as a qa event. Each event covers
the whole request in one record: the retrieval that gathered the context (as
tool calls, whether it ran as a plain or an agentic search) and the answer
generation, with the chunks the answer was grounded in and the indices it cited.
List them with event_type=qa on the
store events or
organization events endpoint, or
open a Store's Metrics tab in the dashboard and switch to Q&A Events.
The retrieval half of a Question Answering request does not also appear under
event_type=search or event_type=agentic_search. Each request shows up
exactly once, as a qa event.