Actions2
Overview
This node enables executing a Retrieval-Augmented Generation (RAG) query using the OneAI service. It allows users to search for relevant information by providing either a natural language query or keywords, optionally filtered by workspaces and content types. The node supports advanced search configurations such as specifying the RAG mode (hybrid, embedding only, or full text only), setting minimum similarity thresholds, and applying reranker models.
Common scenarios where this node is beneficial include:
- Enhancing chatbot or virtual assistant responses by retrieving contextually relevant documents or Q&A pairs.
- Performing semantic search over large document collections or knowledge bases.
- Filtering search results based on metadata or workspace scopes.
Practical example: A user wants to find the top 3 most relevant documents or Q&A entries related to "artificial intelligence" across multiple workspaces, using a hybrid search mode with custom weights for embedding and full-text indices.
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. Filters out less relevant results. |
Metadata Filter | Specify the metadata filter type to use. Currently, only "default" is supported. Leave empty if not used. |
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 defining Reciprocal Rank Fusion (RRF) weights for different search indices. Only effective when RAG mode is Hybrid and this field is not empty. Example: {"Embedding": 0.9, "FullText": 0.8} |
Reranker | Specify the reranker model to use. Leave empty if not used. Example: "default_reranker_model_name" |
Output
The node outputs JSON data containing the search results returned by the OneAI RAG API. This typically includes an array of matched documents or Q&A entries with associated metadata such as similarity scores, content snippets, and identifiers.
No binary data output is indicated for this operation.
Dependencies
- Requires an API key credential for authenticating with the OneAI service.
- The base URL for the API is derived from the credential configuration.
- The node sends POST requests to the
/v1/openapi/rag
endpoint of the OneAI API.
Troubleshooting
- Empty Query and Keywords: The node requires at least one of the "Query" or "Keywords" properties to be non-empty. If both are empty, the API request will likely fail or return no results.
- Invalid JSON in Weights: When specifying weights for the hybrid RAG mode, ensure the JSON string is valid. Malformed JSON will cause parsing errors.
- Minimum Similarity Out of Range: The "Minimum Similarity" must be between 0 and 1. Values outside this range may cause validation errors.
- Workspace Names/IDs Format: Ensure that workspace names or IDs are correctly comma-separated without extra spaces or invalid characters.
- API Authentication Errors: Verify that the API key credential is correctly configured and has sufficient permissions.
- Unsupported Metadata Filter: Currently, only the "default" metadata filter is supported. Using other values may result in ignored filters or errors.
Links and References
- OneAI Official Documentation (for API details and usage)
- Reciprocal Rank Fusion (RRF) Explanation (for understanding weights in hybrid mode)