Super Prompts icon

Super Prompts

Intelligent system prompt routing using multiple prompts and a router model

Super Prompts

AI-generated

Overview

This node, named Super Prompts, intelligently routes user queries to the most appropriate system prompt and language model (LLM) based on the content of the query. It is designed to work with multiple system prompts, each tailored for different types of queries, and uses a router model to decide which prompt and LLM to use. This is beneficial in scenarios where diverse expertise or response styles are needed, such as technical support, creative writing, or specialized knowledge domains. For example, it can route mathematical queries to a math expert prompt and creative writing tasks to a creative writer prompt, optimizing the response quality.

Use Case Examples

  1. Routing user queries to different LLMs based on the query type, e.g., math problems to a math expert prompt and creative tasks to a creative writer prompt.
  2. Using multiple system prompts to handle diverse user requests within a single workflow, improving response relevance and accuracy.

Properties

Name Meaning
Router Model Info Information notice about configuring a router model in credentials to select the best system prompt based on user queries.
System Prompts A collection of multiple system prompts, each with a label, description of when to use it, the actual system prompt text, and the index of the connected LLM to use for that prompt.
Router Model The model used for routing decisions and generating final responses, e.g., GPT-4.1 Mini or GPT-4.1 Nano.
Routing Temperature Temperature setting for routing decisions, where lower values make the routing more deterministic.

Output

JSON

  • _llmType - Indicates the type of the LLM wrapper used by this node.
  • invoke - An asynchronous function that takes user messages, routes the query to the best system prompt and LLM, and returns the LLM's response.

Dependencies

  • Requires OpenAI API credentials for the router model.

Troubleshooting

  • Error if the number of connected LLMs is less than required by the configured prompts. Ensure all required LLM connections are established.
  • Error if no OpenAI API credentials are provided for the router model. Provide valid OpenAI API credentials.
  • Error if no system prompts are configured. Configure at least one system prompt.
  • Error if a prompt is configured to use an LLM connection index that is not connected. Verify LLM connections and prompt configurations.

Discussion