Rules engine for dynamic contextual routing to artificial intelligence models
The invention provides a rules engine that manages user requests within an interface integrating multiple AI platforms and AI Models. Upon receiving a query, the engine assigns scores based on factors like management rules, user preferences, and contextual information. Determinative scores, such as those enforcing strict enterprise policies, can override others, leading the engine to block or reroute the query. If no score is determinative, the engine forwards the query and associated prompts to a specialized routing AI Model for contextual analysis. Based on this analysis, the rules engine directs the query to the most appropriate AI Model or defaults to the user-designated AI Model. This system balances user intent with rule enforcement, optimizing query processing across various AI platforms while ensuring compliance with enterprise guidelines.
1 . A method for routing a request to an appropriate artificial intelligence (“AI”) model, comprising:
receiving a first request at a server, the first request including an identification of an intended AI model for receiving the first request;
sending the first request to a routing AI model for contextual analysis, the routing AI model evaluating the first request against a plurality of available AI models;
receiving a contextual analysis result from the routing AI model, the contextual analysis result indicating whether the intended AI model should handle the first request; and
in an instance in which the contextual analysis result from the routing AI model indicates that the first request should not be sent to the intended AI model, causing the first request to be blocked from being sent to the intended AI model and rerouting the first request to a different AI model.
2 . The method of claim 1 , further comprising:
determining whether sending the first request to the intended AI model violates one or more management rules; and
in an instance in which sending the first request to the intended AI model violates the one or more management rules, blocking the first request from being sent to the intended AI model.
3 . The method of claim 1 , wherein the intended AI model is a managed AI model, and the contextual analysis result from the routing AI model indicates that the first request should be sent to a personal AI model.
4 . The method of claim 3 , further comprising:
determining whether sending the first request to the personal AI model violates one or more management rules;
in an instance in which sending the first request to the personal AI model violates the one or more management rules, blocking the first request from being sent to the personal AI model; and
in an instance in which sending the first request to the personal AI model does not violate the one or more management rules, sending the first request to the personal AI model.
5 . The method of claim 1 , wherein the contextual analysis result from the routing AI model includes a confidence score, the method further comprising:
based on comparing the confidence score to a confidence score threshold, determining that the first request should not be sent to the intended AI model.
6 . The method of claim 5 , wherein a management rule specifies the confidence score threshold.
7 . The method of claim 1 , wherein the first request is received from a user device, and wherein the first request is based on a selection in a user interface (“UI”), the UI including a first window associated with a managed AI model and a second window associated with a personal AI model.
8 . The method of claim 1 , further comprising:
receiving a second request associated with a personal AI model;
determining that sending the second request to the personal AI model violates one or more management rules; and
blocking the second request from being sent to a managed AI model.
9 . The method of claim 8 , further comprising:
determining that sending the second request to the managed AI model complies with the one or more management rules; and
causing the second request to be sent to the managed AI model.
10 . The method of claim 8 , further comprising:
sending the second request to the routing AI model for contextual analysis; and
receiving second contextual analysis results from the routing AI model, the second contextual analysis results indicating that the managed AI model should handle the second request.
11 . The method of claim 10 , further comprising:
determining whether sending the second request to the managed AI model violates the one or more management rules;
in an instance in which sending the second request to the managed AI model violates the one or more management rules, blocking the second request from being sent to the managed AI model; and
in an instance in which sending the second request to the managed AI model does not violate one or more management rules, sending the second request to the managed AI model.
12 . The method of claim 1 , further comprising identifying a group to the routing AI model, wherein a user profile specifies that a user associated with the first request is part of the group wherein the group is associated with a confidence score threshold for routing the first request to the intended AI model, and wherein a system prompt includes instructions for utilizing the group in the contextual analysis.
13 . The method of claim 1 , further comprising identifying a compliance score to the routing AI model, wherein the compliance score is based on one or more management rules applied to the first request, and wherein a system prompt includes instructions for utilizing the compliance score in the contextual analysis.
14 . The method of claim 1 , further comprising sending a system prompt to the routing AI model, wherein the system prompt describes at least one of purpose or restrictions corresponding to each available AI model.
15 . The method of claim 1 , further comprising receiving compliance data in association with the first request, wherein the compliance data and first request are received from a user device, and wherein a management controller that executes on the user device supplies the compliance data.
16 . The method of claim 15 , further comprising sending a ruleset to the user device, wherein the management controller applies the ruleset to generate the compliance data.
17 . The method of claim 16 , wherein the ruleset includes a geographic constraint that applies to the user device, and wherein the management controller applies the geographic constraint to limit which AI models are available for selection on a user interface (“UI”).
18 . The method of claim 1 , wherein context utilized by the routing AI model in the contextual analysis includes a time and location of the first request.
19 . A non-transitory, computer-readable medium containing instructions that, when executed by a hardware-based processor, causes the hardware-based processor to perform stages for routing a request to an appropriate artificial intelligence (“AI”) model, comprising:
receiving a first request at a server, the first request including an identification of an intended AI model;
sending the first request to a routing AI model for contextual analysis, the routing AI model evaluating the first request against a plurality of available AI models;
receiving a contextual analysis result from the routing AI model, the contextual analysis result indicating whether the intended AI model should handle the first request; and
in an instance in which the contextual analysis result from the routing AI model indicates that the first request should not be sent to the intended AI model, causing the first request to be blocked from being sent to the intended AI model and rerouting the first request to a different AI model.
20 . A system for routing a request to an appropriate artificial intelligence (“AI”) model, comprising:
a memory storage including a non-transitory, computer-readable medium comprising instructions; and
at least one hardware-based processor that executes the instructions to carry out stages comprising:
receiving a first request at a server, the first request including an identification of an intended AI model;
sending the first request to a routing AI model for contextual analysis, the routing AI model evaluating the first request against a plurality of available AI models;
receiving a contextual analysis result from the routing AI model, the contextual analysis result indicating whether the intended AI model should handle the first request; and
in an instance in which the contextual analysis result from the routing AI model indicates that the first request should not be sent to the intended AI model, causing the first request to be blocked from being sent to the intended AI model and rerouting the first request to a different AI model.