Querying Knowledge Bases
Search and retrieve information from your documents.
Agent Integration
When you attach a knowledge base to an agent:
- Agent receives a user question
- Automatically searches the knowledge base
- Retrieves relevant chunks
- Includes them in context for the response
Workflow Integration
Use the Knowledge Base Query node:
// Output
{{kb_query.results}} // Array of matching chunks
{{kb_query.results[0].content}} // First result text
{{kb_query.results[0].score}} // Similarity score
API Querying
curl -X POST https://api.flowmaestro.ai/knowledge-bases/{id}/query \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the return policy?",
"topK": 5
}'
Search Parameters
| Parameter | Description | Default |
|---|---|---|
query | Search text | Required |
topK | Max results to return | 5 |
scoreThreshold | Minimum similarity (0-1) | 0.0 |