# US 12,769,782 B2 · Using artificial intelligence agents for servicing search queries

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

- Number: US 12,769,782 B2
- Document ID: US12769782B2
- Status: Granted
- Kind: B2
- Application number: 19/090,346
- Filed: 2025-03-25
- Published: 2026-10-01
- Granted: 2026-10-20
- Earliest claimed: 2025-03-25
- Assignees: Maplebear Inc.
- Applicants: Maplebear Inc.
- Inventors: Yuanzheng Zhu; Akshay Nair; Taesik Na; Tejaswi Tenneti; Shrikar Archak; Raochuan Fan
- Web page: https://patentgrep.com/patent/US12769782B2

## CPC

- G06F 16/383: using metadata automatically derived from the content
- G06F 16/3329: Natural language query formulation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed herein is a system for selecting complementary items to display in response to a search query. The system receives a query entered at a search interface presented at a client device. The system determines items associated with the query and selects complementary items based on the query. The system applies a first generative language model tuned to score complementary items based on presentation requirements. The system applies a second generative language model tuned to score complementary items based on historical presentation instances. The system aggregates scores output by the first and second generative models and ranks the complementary items based on the aggregate scores. The system sends ranked complementary items for display at the search interface.

## Claims

### Claim 1

A method, performed at a computer system comprising a processor and a computer-readable medium, comprising:
receiving, from a client device, a search query entered at an item search interface presented at the client device;
retrieving one or more items that are responsive to the search query;
selecting a set of complementary items to the one or more items that are responsive to the search query;
applying a first generative language model to each of the set of complementary items, wherein the first generative language model is tuned on presentation requirements for each of the set of complementary items, wherein the presentation requirements associated with each complementary item include a prospective number of presentation instances for the respective complementary item at one or more client devices;
receiving, from the first generative language model, a first set of scores for the complementary items;
applying a second generative language model to the set of complementary items, wherein the second generative language model is tuned with historical presentation instances of each of the set of complementary items;
receiving, from the second generative language model, a second set of scores for the complementary items;
aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores;
ranking the set of complementary items based on the aggregate scores; and
sending, to the client device, the ranked set of complementary items and the one or more items for display at the item search interface presented at the client device.

### Claim 2 (depends on 1)

The method of claim 1, wherein selecting complementary items to the one or more items that are responsive to the search query comprises:
applying a third generative language model to the one or more items that are responsive to the search query, wherein the third generative language model is tuned on measures of similarity between items.

### Claim 3 (depends on 1)

The method of claim 1, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
receiving a desired item number and priority ratio;
selecting a first subset of the first set of scores and a second subset of the second set of scores, wherein the first subset and second subset combined comprise the desired item number and a ratio of the first subset to the second subset comprise the priority ratio; and
combining the first subset and second subset into a ranked list of scores.

### Claim 4 (depends on 3)

The method of claim 3, wherein each of the first set of scores and the second set of scores includes a first subscore and a second subscore, the method further comprising:
ranking the complementary items into a first ranking by first subscore and a second ranking by second subscore, wherein the first subscore represents a numerical representation of a respective complementary item and the second subscore represents presentation instances associated with the respective complementary item;
selecting the first subset of the first set of scores from the first ranking and the second subset of the second set of scores from the second ranking;
determining a combined score for each complementary item in the first subset and second subset, wherein the combined score is based on the first subscore and the second subscore; and
ranking the first subset and second subset into a third ranking based on the combined scores.

### Claim 5 (depends on 1)

The method of claim 1, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
creating an input prompt for a third generative language model, wherein the input prompt includes the first set of scores and second set of scores, each score associated with a respective complementary item; and
inputting the prompt to the third generative language model, the third generative language model tuned to output an aggregate score for each complementary item of the prompt.

### Claim 6 (depends on 5)

The method of claim 5, wherein each score is associated with a numerical representation that indicates a prospective number of presentation instances for a respective complementary item or a number of presentation instances representing a level of interest in the respective complementary item.

### Claim 7 (depends on 1)

The method of claim 1, wherein sending the ranked set of complementary items and the one or more items for display comprises:
causing the item search interface to display the one or more items in a first carousel and the ranked set of complementary items in a second carousel.

### Claim 8

A non-transitory computer-readable storage medium storing instructions that, when executed, cause a processor to perform steps comprising:
receiving, from a client device, a search query entered at an item search interface presented at the client device;
retrieving one or more items that are responsive to the search query;
selecting a set of complementary items to the one or more items that are responsive to the search query;
applying a first generative language model to each of the set of complementary items, wherein the first generative language model is tuned on presentation requirements for each of the set of complementary items, wherein the presentation requirements associated with each complementary item include a prospective number of presentation instances for the respective complementary item at one or more client devices;
receiving, from the first generative language model, a first set of scores for the complementary items;
applying a second generative language model to the set of complementary items, wherein the second generative language model is tuned with historical presentation instances of each of the set of complementary items;
receiving, from the second generative language model, a second set of scores for the complementary items;
aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores;
ranking the set of complementary items based on the aggregate scores; and
sending, to the client device, the ranked set of complementary items and the one or more items for display at the item search interface presented at the client device.

### Claim 9 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein selecting complementary items to the one or more items that are responsive to the search query comprises:
applying a third generative language model to the one or more items that are responsive to the search query, wherein the third generative language model is tuned on measures of similarity between items.

### Claim 10 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
receiving a desired item number and priority ratio;
selecting a first subset of the first set of scores and a second subset of the second set of scores, wherein the first subset and second subset combined comprise the desired item number and a ratio of the first subset to the second subset comprise the priority ratio; and
combining the first subset and second subset into a ranked list of scores.

### Claim 11 (depends on 10)

The non-transitory computer-readable storage medium of claim 10, wherein each of the first set of scores and the second set of scores includes a first subscore and a second subscore, the steps further comprising:
ranking the complementary items into a first ranking by first subscore and a second ranking by second subscore, wherein the first subscore represents a numerical representation of a respective complementary item and the second subscore represents presentation instances associated with the respective complementary item;
selecting the first subset of the first set of scores from the first ranking and the second subset of the second set of scores from the second ranking;
determining a combined score for each complementary item in the first subset and second subset, wherein the combined score is based on the first subscore and the second subscore; and
ranking the first subset and second subset into a third ranking based on the combined scores.

### Claim 12 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
creating an input prompt for a third generative language model, wherein the input prompt includes the first set of scores and second set of scores, each score associated with a respective complementary item; and
inputting the prompt to the third generative language model, the third generative language model tuned to output an aggregate score for each complementary item of the prompt.

### Claim 13 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein each score is associated with a numerical representation that indicates a prospective number of presentation instances for a respective complementary item or a number of presentation instances representing a level of interest in the respective complementary item.

### Claim 14 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein sending the ranked set of complementary items and the one or more items for display comprises:
causing the item search interface to display the one or more items in a first carousel and the ranked set of complementary items in a second carousel.

### Claim 15

A system comprising:
a processor; and
a non-transitory computer-readable storage medium storing instructions that, when executed, cause the processor to perform steps comprising:
receiving, from a client device, a search query entered at an item search interface presented at the client device;
retrieving one or more items that are responsive to the search query;
selecting a set of complementary items to the one or more items that are responsive to the search query;
applying a first generative language model to each of the set of complementary items, wherein the first generative language model is tuned on presentation requirements for each of the set of complementary items, wherein the presentation requirements associated with each complementary item include a prospective number of presentation instances for the respective complementary item at one or more client devices;
receiving, from the first generative language model, a first set of scores for the complementary items;
applying a second generative language model to the set of complementary items, wherein the second generative language model is tuned with historical presentation instances of each of the set of complementary items;
receiving, from the second generative language model, a second set of scores for the complementary items;
aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores;
ranking the set of complementary items based on the aggregate scores; and
sending, to the client device, the ranked set of complementary items and the one or more items for display at the item search interface presented at the client device.

### Claim 16 (depends on 15)

The system of claim 15, wherein selecting complementary items to the one or more items that are responsive to the search query comprises:
applying a third generative language model to the one or more items that are responsive to the search query, wherein the third generative language model is tuned on measures of similarity between items.

### Claim 17 (depends on 15)

The system of claim 15, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
receiving a desired item number and priority ratio;
selecting a first subset of the first set of scores and a second subset of the second set of scores, wherein the first subset and second subset combined comprise the desired item number and a ratio of the first subset to the second subset comprise the priority ratio; and
combining the first subset and second subset into a ranked list of scores.

### Claim 18 (depends on 17)

The system of claim 17, wherein each of the first set of scores and the second set of scores includes a first subscore and a second subscore, the steps further comprising:
ranking the complementary items into a first ranking by first subscore and a second ranking by second subscore, wherein the first subscore represents a numerical representation of a respective complementary item and the second subscore represents presentation instances associated with the respective complementary item;
selecting the first subset of the first set of scores from the first ranking and the second subset of the second set of scores from the second ranking;
determining a combined score for each complementary item in the first subset and second subset, wherein the combined score is based on the first subscore and the second subscore; and
ranking the first subset and second subset into a third ranking based on the combined scores.

### Claim 19 (depends on 15)

The system of claim 15, wherein aggregating, for each of the set of complementary items, respective scores from the first set of scores and the second set of scores comprises:
creating an input prompt for a third generative language model, wherein the input prompt includes the first set of scores and second set of scores, each score associated with a respective complementary item; and
inputting the prompt to the third generative language model, the third generative language model tuned to output an aggregate score for each complementary item of the prompt.

### Claim 20 (depends on 15)

The system of claim 15, wherein sending the ranked set of complementary items and the one or more items for display comprises:
causing the item search interface to display the one or more items in a first carousel and the ranked set of complementary items in a second carousel.
