Query a document store to retrieve relevant documents based on semantic similarity. This is useful for testing retrieval or building custom search interfaces.
Request Body
The unique identifier of the document store to query
Number of documents to return. Default: 4
Whether to include document metadata. Default: true
Response
Array of retrieved documents
Document Object
The text content of the document chunk
Metadata associated with the document
Similarity score (0-1, where 1 is most similar)
Example Request
curl -X POST \
'https://your-flowise-instance.com/api/v1/document-store/vectorstore/query' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"storeId": "store-123",
"query": "How do I reset my password?",
"k": 3
}'
Example Response
{
"documents": [
{
"pageContent": "To reset your password, click on the 'Forgot Password' link on the login page. Enter your email address and you'll receive instructions to create a new password.",
"metadata": {
"source": "user-guide.pdf",
"page": 12,
"category": "authentication"
},
"score": 0.92
},
{
"pageContent": "Password requirements: At least 8 characters, one uppercase letter, one number, and one special character. Passwords expire every 90 days.",
"metadata": {
"source": "security-policy.pdf",
"page": 5,
"category": "security"
},
"score": 0.78
},
{
"pageContent": "If you're having trouble resetting your password, contact support at [email protected] or call 1-800-SUPPORT.",
"metadata": {
"source": "faq.txt",
"category": "support"
},
"score": 0.73
}
]
}
Query Parameters
k (Top-K Results)
The k parameter controls how many documents to return:
- Higher values return more results but may include less relevant documents
- Lower values return fewer but more relevant results
- Typical range: 3-10
Score Interpretation
- 0.9 - 1.0 - Highly relevant
- 0.7 - 0.9 - Relevant
- 0.5 - 0.7 - Somewhat relevant
- < 0.5 - Marginally relevant
Use Cases
- Testing Retrieval - Test document store search quality
- Custom Search - Build custom search interfaces
- Analytics - Analyze document relevance
- Debugging - Debug retrieval issues in flows
Error Responses
Bad Request - Missing required fields (storeId or query)
Unauthorized - Invalid or missing API key
Forbidden - Insufficient permissions to query document store
Not Found - Document store not found
Internal Server Error - Error querying document store