Actions2
Overview
This node integrates with the OneAI platform to perform Retrieval-Augmented Generation (RAG) queries. It allows users to search for relevant information by providing either a natural language query or keywords, optionally filtered by workspace and content type. The node supports advanced search configurations such as similarity thresholds, metadata filtering, and different RAG modes (hybrid, embedding-only, or full-text only). This is useful in scenarios where you want to retrieve contextually relevant documents or Q&A pairs from a knowledge base to augment AI-generated responses or to power intelligent search features.
Practical examples:
- Asking "What is artificial intelligence?" to retrieve top relevant documents and Q&A entries from multiple workspaces.
- Searching with keywords like "AI|Machine Learning|Deep Learning" to find related content across selected workspaces.
- Using hybrid RAG mode with custom weights to balance embedding and full-text search results for more precise retrieval.
Properties
| Name | Meaning |
|---|---|
| Query | The question or content to search for. Cannot be empty if Keywords are also empty. Example: "What is artificial intelligence?" |
| Keywords | Keywords separated by " |
| Workspaces (Comma-Separated) | Comma-separated list of workspace names or IDs to restrict the search scope. Leave empty to search all accessible workspaces. Example: "workspace_alpha,workspace_beta_id" |
| RAG Object Type | Specify the content type to search: All (Q&A and Documents), Q&A Only, or Documents Only |
| Top K Results | Number of search results to return. Minimum value is 1. Default is 3 |
| Minimum Similarity | Minimum similarity score for results, ranging from 0 to 1. Default is 0.8 |
| Metadata Filter | Metadata filter type to use. Currently only supports "default". Leave empty if not used |
| Metadata Search Type | Specify the metadata search type: Filtration or Sort |
| RAG Mode | Specify the RAG search mode: Hybrid (Embedding and Full Text), Embedding Only, or Full Text Only |
| Weights (JSON for Hybrid Mode) | JSON object specifying RRF weights for different search indices (e.g., {"Embedding": 0.9, "FullText": 0.8}). Effective only when RAG mode is Hybrid and this field is not empty |
| Reranker | Specify the reranker model to use. Leave empty if not used |
Output
The node outputs JSON data containing the search results returned by the OneAI RAG API. The structure typically includes an array of matched documents or Q&A entries, each with associated metadata such as similarity scores, content snippets, and identifiers. This output can be used downstream in workflows for further processing, display, or decision-making.
No binary data output is indicated for this operation.
Dependencies
- Requires an API key credential for authenticating with the OneAI platform.
- The node sends HTTP POST requests to the OneAI API endpoint
/v1/openapi/rag. - The base URL for the API is configurable via credentials.
- Proper network access to the OneAI service is necessary.
Troubleshooting
- Empty Query and Keywords: The node requires at least one of
QueryorKeywordsto be non-empty. If both are empty, the API call will likely fail or return no results. - Invalid JSON in Weights: When using the
Weightsproperty in Hybrid mode, ensure the JSON string is valid. Malformed JSON will cause parsing errors. - API Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions.
- Workspace Filtering Issues: If specifying workspaces, verify that the workspace names or IDs are correct and accessible by the API key.
- Similarity Threshold Too High: Setting
Minimum Similaritytoo close to 1 may result in no results being returned. - Unsupported Metadata Filter: Currently, only
"default"is supported for metadata filtering; other values may cause errors.
Links and References
- OneAI Platform Documentation (general reference for API capabilities)
- Retrieval-Augmented Generation (RAG) Concepts
- n8n Documentation on Creating Custom Nodes