AI Routing

What is the Routing Node?

The Routing node in Stack AI is a powerful node designed to intelligently classify, categorize, and direct user input within your AI workflow. By leveraging advanced intent detection and categorization, the Routing node enables dynamic branching, ensuring that each user query is handled by the most relevant downstream process or AI model.


Key Features of the Routing Node

  • Intent Classification: Automatically detects the intent or topic of user input, such as general questions or company-specific inquiries.

  • Dynamic Workflow Branching: Routes input to different workflow branches based on detected categories, enabling personalized and context-aware responses.

  • Seamless Integration: Easily connects with LLMs, knowledge bases, and other nodes for advanced AI automation.

  • Customizable Categories: Supports multiple, user-defined categories for granular control over workflow logic.


How the Routing Node Works

  1. Input Reception: The Routing node receives user input, typically from an Input node.

  2. Intent Detection: Using AI-powered classification (e.g., Azure AI), the node analyzes the input and assigns one or more categories. Example categories:

    • [Default] User asks a general question.

    • User asks a question related to the company.

  3. Branching Logic: Based on the assigned categories, the workflow can trigger different downstream nodes, such as specialized LLMs or knowledge base searches.

  4. Workflow Integration: The Routing node is typically placed after the Input node and before nodes like LLMs or knowledge bases, acting as a decision point in the workflow.


Example Use Case

Suppose you want your AI assistant to handle both general and company-specific questions differently:

  • General questions are routed to a general-purpose LLM.

  • Company-related questions are routed to a knowledge base search for more accurate, context-specific answers.

The Routing node makes this possible by categorizing each user query and directing it to the appropriate branch.


Best Practices for Using the Routing Node

  • Define Clear Categories: Ensure your categories are distinct and cover all expected user intents.

  • Always Include a Default Category: This ensures that ambiguous or unexpected inputs are still handled gracefully (e.g., the user asks about other topics).

  • Test with Real User Inputs: Validate that the Routing node assigns categories as expected for a variety of queries.

  • Connect to Multiple Branches: Use the Routing node to trigger different LLMs, knowledge bases, or actions based on detected intent.


Benefits of the Routing Node in Stack AI

  • Provides greater flexibility than a standard if-else node, as it excels at identifying user intent rather than just specific words. It's akin to having a Large Language Model (LLM) manage your workflow, determining the best routing for user queries.


Frequently Asked Questions

Q: Can I customize the categories in the Routing node? A: Yes! You can define as many categories as needed to match your workflow requirements.

Q: What AI models does the Routing node use for classification? A: The Routing node uses an Azure OpenAI for intent detection and classification.

Q: How do I connect the Routing node to other nodes? A: Simply draw edges from the Routing node to downstream nodes corresponding to each category in your workflow editor.


Conclusion

The Routing node is essential for building intelligent, context-aware, and scalable AI workflows in Stack AI. By classifying and directing user input, it ensures that every query is handled by the most appropriate process, enhancing both automation and user satisfaction.

Last updated

Was this helpful?