# US 12,602,550 B2 · Natural language driven planning with machine learning models

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,602,550 B2
- Document ID: US12602550B2
- Status: Granted
- Kind: B2
- Application number: 18/212,687
- Filed: 2023-06-21
- Published: 2024-12-26
- Granted: 2026-04-14
- Earliest claimed: 2023-06-21
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Amir H. Abdi; Nitin Kumar Goel; Daniel Lee Mace; William Blum
- Web page: https://patentgrep.com/patent/US12602550B2

## CPC

- G06F 21/50: Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 16/3347: {using vector based model}
- G06F 21/554: {involving event detection and direct action}
- G06F 40/30: Semantic analysis
- G06N 20/00: Machine learning
- H04L 63/1408: {by monitoring network traffic (monitoring network traffic per se H04L43/00)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Machine learning models are used to generate a plan that responds to a user request. The plan includes one or more skills selected from a list of available skills. The prompt may be written in natural language, enabling the user to express their intent without having to know which skills are available or their intricacies. In some configurations, a skill is included in the plan if an embedding representation of an example prompt associated with the skill is within a defined distance of an embedding representation of the user request. Additionally, or alternatively, the embedding distance computations are used to narrow the list of available skills, which is then used to construct a meta-prompt that selects a skill. Skills listed in the meta-prompt may include data types of parameters and return values. This allows the model that processes the meta-prompt to order skills based on data type compatibility.

## Claims

### Claim 1

A method comprising:
receiving a user request;
computing an embedding of the user request;
selecting a subset of a plurality of example prompts by:
comparing the embedding of the user request to embeddings of the plurality of example prompts, and
selecting the subset of the plurality of example prompts that have prompt embeddings within a defined distance of the embedding of the user request;
identifying a plurality of skills referenced by the subset of the plurality of example prompts;
generating a skill selection meta-prompt that includes a list of the plurality of skills;
providing the skill selection meta-prompt to a machine learning model;
receiving a plan from the machine learning model that includes at least one skill; and
invoking the plan.

### Claim 2 (depends on 1)

The method of claim 1, wherein the embedding and the at least one example prompt embedding are generated by an embedding model.

### Claim 3 (depends on 2)

The method of claim 2, wherein the plurality of skills are selected from a plurality of available skills, wherein each of the plurality of available skills is associated with at least one example prompt, and wherein the at least one example prompt embedding is generated by providing the embedding model with at least one example prompt.

### Claim 4 (depends on 3)

The method of claim 3, wherein the at least one example prompt embedding is pre-computed and stored in a vector database.

### Claim 5 (depends on 1)

The method of claim 1, wherein the at least one example prompt embedding is determined to be within the defined distance of the embedding based on a cosine similarity.

### Claim 6 (depends on 1)

The method of claim 1, wherein the at least one skill has at least one placeholder value, wherein the machine learning model is provided with a user context, and wherein the machine learning model fills in the at least one placeholder value when processing the meta-prompt.

### Claim 7 (depends on 1)

The method of claim 1, wherein at least one entry of the list of the plurality of skills includes a data type of a parameter or a data type of a return value.

### Claim 8

A system comprising:
a processing unit; and
a computer-readable storage medium having computer-executable instructions stored thereupon, which, when executed by the processing unit, cause the processing unit to:
receive a user request;
compute an embedding of the user request;
select a subset of a plurality of example prompts by:
comparing the embedding of the user request to embeddings of the plurality of example prompts, and
selecting the subset of the plurality of example prompts that have prompt embeddings within a defined distance of the embedding of the user request;
identify a plurality of skills referenced by the subset of the plurality of example prompts;
provide the plurality of skills and a user context to a machine learning model;
receive a plan from the machine learning model that includes at least one of the plurality of skills customized to the current user context; and
invoke the plan.

### Claim 9 (depends on 8)

The system of claim 8, wherein invoking the plan generates a response to the user request, and wherein the instructions further cause the processing unit to:
return the response to the user.

### Claim 10 (depends on 8)

The system of claim 8, wherein the user context includes a chat history.

### Claim 11 (depends on 8)

The system of claim 8, wherein the machine learning model comprises a auto-regressive generative language model.

### Claim 12 (depends on 8)

The system of claim 8, wherein the plurality of skills are selected by searching a vector database for example prompt embeddings that are within a defined distance of the embedding.

### Claim 13 (depends on 8)

The system of claim 8, wherein the defined distance of the embedding of the user request is computed based on a Euclidian distance.

### Claim 14 (depends on 8)

The system of claim 8, wherein a skill fill prompt sent to the machine learning model causes the machine learning model to replace placeholder parameters with values extracted from the user context.

### Claim 15

A non-transitory computer-readable storage medium having encoded thereon computer-readable instructions that when executed by a processing unit causes a system to:
receive a user request;
compute an embedding of the user request;
select a subset of a plurality of example prompts by:
comparing the embedding of the user request to embeddings of the plurality of example prompts, and
selecting the subset of the plurality of example prompts that have prompt embeddings within a defined distance of the embedding of the user request;
identify a plurality of skills referenced by the subset of the plurality of example prompts;
generate a skill selection meta-prompt that includes a list of the plurality of skills, wherein a return value of a first skill of the plurality of skills and a parameter of a second skill of the plurality of skills have a same data type;
provide the skill selection meta-prompt to a machine learning model;
receive a plan from the machine learning model in which the return value of the first skill is provided to the parameter of the second skill; and
invoke the plan.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein generating the skill selection meta-prompt comprises replacing a placeholder value of a generic skill selection meta-prompt with the list of the plurality of skills.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium of claim 16, wherein the list of the plurality of skills includes a name and a description of at least one skill and a name of at least one parameter of at least one skill.

### Claim 18 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the list of the plurality of skills includes a data type for the at least one parameter.

### Claim 19 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the list of the plurality of skills includes a data type for a return value of at least one of the plurality of skills.

### Claim 20 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the identified plurality of skills does not have any skills, and wherein the list of the plurality of skills in the skill-selection meta-prompt comprises a plurality of low-level skills.
