Overview
This node integrates with Docutray services to perform searches within knowledge bases. Specifically, the "Knowledge Base - Search" operation allows users to query a selected knowledge base for relevant documents or information based on a search string. This is useful in scenarios where you want to quickly retrieve contextual data or answers from a curated set of documents, such as company manuals, FAQs, or technical documentation.
Practical examples include:
- Searching a product knowledge base to find troubleshooting steps.
- Querying an internal policy repository to extract relevant guidelines.
- Retrieving customer support articles matching a user's question.
Properties
| Name | Meaning |
|---|---|
| Knowledge Base Name or ID | Select a knowledge base from a dropdown list or enter its ID manually. This identifies which knowledge base to search. |
| Query | The search query string (up to 1000 characters) used to find relevant content within the knowledge base. |
| Limit | Maximum number of search results to return. Defaults to 50. |
| Similarity Threshold | Minimum similarity score (between 0 and 1) that a result must meet to be included. Default is 0.7. |
| Include Metadata | Boolean flag indicating whether to include metadata along with search results. Defaults to true. |
Output
The output is a JSON array where each item corresponds to the search results returned by the Docutray API for the given query. The structure includes:
- The main search results data as returned by the API, which typically contains matched documents or entries.
- If enabled, metadata associated with each search result is included, providing additional context or attributes about the matched items.
No binary data is output by this operation.
Dependencies
- Requires an active Docutray API key credential configured in n8n for authentication.
- The node makes HTTP POST requests to the Docutray API endpoint:
https://app.docutray.com/api/knowledge-bases/{knowledgeBaseId}/search. - The node expects the API to respond with JSON-formatted search results.
Troubleshooting
- Empty or no results: Ensure the knowledge base ID is correct and the query string is meaningful. Also, check if the similarity threshold is not set too high, which might filter out valid results.
- Invalid API credentials: Authentication errors indicate issues with the configured API key. Verify the API key is valid and has necessary permissions.
- Malformed query or parameters: The query string should not exceed 1000 characters. Invalid parameter types or missing required fields will cause errors.
- API request failures: Network issues or API downtime can cause request failures. Check connectivity and Docutray service status.
- JSON parsing errors: If the API returns unexpected data formats, the node may fail to parse the response. This is rare but could happen if the API changes.
Links and References
- Docutray API Documentation (for detailed API usage)
- n8n Expressions Documentation (for using expressions in property values)