Overview
This node integrates with an AI-powered search API to perform intelligent, context-aware search queries. It is designed to enhance search experiences by embedding the query and optionally including previous conversation context to improve relevance and accuracy of results.
Common scenarios where this node is beneficial include:
- Implementing advanced search features in chatbots or virtual assistants.
- Retrieving detailed information from large datasets using natural language queries.
- Enhancing customer support systems with contextual search capabilities.
For example, a user can input a question like "What is machine learning?" along with prior conversation messages to get a rich, formatted answer that considers the ongoing dialogue.
Properties
| Name | Meaning |
|---|---|
| Query | The main search query string to be embedded and used for retrieval. Example: "What is machine learning?" |
| Additional Options | A collection of optional parameters to customize the search request: |
| - Response Type | Format of the response: either "Markdown" (rich formatted text) or "Text" (plain text). |
| - Context | Previous conversation messages to provide enhanced context. Multiple messages can be added, each with content text. |
| - Timeout | Request timeout in milliseconds (range: 1000 to 120000). Default is 30000 ms (30 seconds). |
Output
The node outputs JSON data containing the search results returned by the AI Search API. The structure depends on the API response but generally includes the answer or relevant information based on the query and context provided.
If multiple results are returned as an array, each item is output separately. The output does not include binary data.
Example output JSON snippet might look like:
{
"answer": "Machine learning is a field of artificial intelligence...",
"source": "...",
"metadata": { ... }
}
Dependencies
- Requires an API key credential for authenticating with the AI Search API service.
- The node makes HTTP requests to
https://api.aisearchapi.io/v1/search. - Proper configuration of the API key credential within n8n is necessary.
- Network connectivity to the external AI Search API endpoint is required.
Troubleshooting
- Timeouts: If the request takes longer than the specified timeout, it will fail. Increase the timeout value if needed.
- Authentication errors: Ensure the API key credential is valid and has proper permissions.
- Invalid query or context: Providing empty or malformed queries/context may result in errors or unexpected responses.
- API errors: The node surfaces error messages returned by the API. Common errors include rate limits or invalid parameters.
- Continue On Fail: If enabled, the node will continue processing subsequent items even if some fail, returning error details in the output.
Links and References
- AI Search API Documentation (hypothetical link)
- n8n Documentation on Creating Custom Nodes
- General info on Contextual Search