Question Answering
Question answering
ApiKeyAuthAuthorizationBearer <token>Api key to access Mixedbreads API
application/json- body
The question answering query
store_identifiers*array<string|>IDs or names of stores
1 <= items <= 64top_k?Top KNumber of results to return
1 <= value <= 1000010filters?||array<|>|Optional filter conditions
file_ids?array<any>|array<>|Optional list of file IDs to filter chunks by (inclusion filter)
query?QueryQuestion to answer. If not provided, the question will be extracted from the passed messages.
1 <= lengthsearch_options?Search configuration options
stream?StreamInternal: when set, the response is a server-sent event stream of the retrieved chunks, live trace events, and finally the answer. Used by the Mixedbread playground; not part of the documented public API.
falseinstructions?|Additional custom instructions (followed only when not in conflict with existing rules)
qa_options?Question answering configuration options
The answer to the question
application/json- response
Results from a question answering operation.
answer*AnswerThe answer generated by the LLM
sources?array<|||>Source documents used to generate the answer
[key: string]?anyfrom 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)
{
"answer": "Based on the documentation, the main features of the product include:\n\n1. **Real-time data processing** - The system can process up to 10,000 requests per second with sub-millisecond latency.\n\n2. **Advanced analytics dashboard** - Provides comprehensive insights with customizable charts and reports for tracking key metrics.\n\n3. **API integration** - RESTful API with support for webhooks and batch operations, making it easy to integrate with existing systems.\n\n4. **Security features** - Enterprise-grade security with end-to-end encryption, SSO support, and compliance with SOC 2 and GDPR standards.\n\n5. **Scalability** - Auto-scaling infrastructure that grows with your needs, supporting from small teams to enterprise deployments.",
"sources": [
{
"chunk_index": 3,
"mime_type": "text/plain",
"model": "mxbai-omni",
"score": 0.9234,
"file_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"filename": "product_overview.pdf",
"store_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"metadata": {
"page": 2,
"section": "features"
},
"type": "text",
"text": "Our product offers real-time data processing capabilities, handling up to 10,000 requests per second..."
},
{
"chunk_index": 7,
"mime_type": "text/plain",
"model": "mxbai-omni",
"score": 0.8956,
"file_id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"filename": "technical_specs.pdf",
"store_id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"metadata": {
"page": 5,
"section": "architecture"
},
"type": "text",
"text": "The platform includes an advanced analytics dashboard with customizable charts and reporting tools..."
}
]
}