Question Answering
POST/v1/stores/question-answering
AuthorizationLink to section
Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`
Request BodyLink to section
Question to answer. If not provided, the question will be extracted from the passed messages.
Constraints
IDs or names of stores to search
Constraints
10Number of results to return
Constraints
Optional list of file IDs to filter chunks by (inclusion filter)
Constraints
falseWhether to stream the answer
Additional custom instructions (followed only when not in conflict with existing rules)
Constraints
Response BodyLink to section
The answer generated by the LLM
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){
"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": "{{FILE_ID}}",
"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..."
}
]
}List Store Chunks
List store chunks purely by metadata filters — no embeddings, no semantic similarity, no reranking. Useful for ranked retrieval over numeric metadata attributes.
Grep Store Chunks
Match store chunks against a regular expression. Unlike `/stores/search`, this runs your regex against the literal text of each chunk. Use it to find chunks containing a specific token, identifier, error code, or literal phrase.