# US 2026/0099516 A1 · Llm-based context selection for a user request

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

- Number: US 2026/0099516 A1
- Document ID: US20260099516A1
- Status: Published application
- Kind: A1
- Application number: 18/907,969
- Filed: 2024-10-07
- Published: 2026-04-09
- Earliest claimed: 2024-10-07
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Felix SCHUBERT; Georgi Savov DAMYANOV; Martin HAEUSER; Andreas KUNZ
- Web page: https://patentgrep.com/patent/US20260099516A1

## CPC

- G06F 16/3329: Natural language query formulation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system may include a user data store containing items, each item containing an item identifier. The items might comprise, for example, files and file names arranged in a hierarchy. A context enhancement platform may then receive a user request from a user device. The context enhancement platform constructs and outputs a first Large Language Model (“LLM”) query, from a context selector to a first LLM. The first LLM query may be, for example, designed to select relevant items from the user data store. Based on a response to the first LLM query, the context enhancement platform constructs and outputs a second LLM query, from a prompt generator to a second LLM. The second LLM query may, according to some embodiments, include information about the user request and information about the relevant items.

## Claims

### Claim 1

A system, comprising:
a user data store containing items, each item containing an item identifier; and
a context enhancement platform, coupled to the user data store, including:
a computer processor, and
a computer memory storing instructions that when executed by the computer processor cause the context enhancement platform to:
receive a user request from a user device,
construct and output a first Large Language Model (“LLM”) query, from a context selector to a first LLM, the first LLM query being designed to select relevant items from the user data store, and
based on a response to the first LLM query, construct and output a second LLM query, from a prompt generator to a second LLM, the second LLM query including information about the user request and information about the relevant items.

### Claim 2 (depends on 1)

The system of claim 1, wherein information about a response to the second LLM is transmitted to the user device.

### Claim 3 (depends on 1)

The system of claim 1, wherein the items are documents and the item identifiers are document titles.

### Claim 4 (depends on 3)

The system of claim 3, wherein the documents comprise files and the document titles are file names.

### Claim 5 (depends on 1)

The system of claim 1, wherein the items in the user data store are arranged in a hierarchy and the first LLM query is further based on information about the hierarchy.

### Claim 6 (depends on 1)

The system of claim 1, wherein the user request is a request to perform a software coding task, and the context enhancement platform is associated with an Artificial Intelligence (“AI”) coding assistant.

### Claim 7 (depends on 6)

The system of claim 6, wherein the second LLM query is further based on at least one of: (i) a user selected code portion, and (ii) user selected open code window tabs.

### Claim 8 (depends on 7)

The system of claim 7, wherein the second LLM query includes information about at least one of the following: (i) a user request history, (ii) instructions about how the items interact, and (iii) a requested output format.

### Claim 9 (depends on 1)

The system of claim 1, wherein the user device is associated with an automated Artificial Intelligence (“AI”) agent.

### Claim 10 (depends on 1)

The system of claim 1, wherein the first and second LLM comprise a single LLM.

### Claim 11 (depends on 1)

The system of claim 1, wherein the second LLM is a different model than, and independent of, the first LLM.

### Claim 12 (depends on 11)

The system of claim 11, wherein the first LLM is internal to the context enhancement platform and the second LLM is external to the context enhancement platform.

### Claim 13 (depends on 1)

The system of claim 1, wherein the user data store contains a user table and the items are portions of the user table.

### Claim 14

A computer-implemented method, comprising:
receiving, at a computer processor of a context enhancement platform, a user request from a user device;
constructing and outputting a first Large Language Model (“LLM”) query, from a context selector to an internal LLM, the first LLM query being designed to select relevant files names in a user data store, the user data store containing coding files with each file containing a file name;
based on a response to the first LLM query, constructing and outputting a second LLM query, from a prompt generator to an external LLM, the second LLM query including information about the user request and information about the relevant coding files; and
arranging for information about a response to the second LLM query to be transmitted to the user device.

### Claim 15 (depends on 14)

The method of claim 14, wherein the coding files in the user data store are arranged in a hierarchy and the first LLM query is further based on information about the hierarchy.

### Claim 16 (depends on 15)

The method of claim 15, wherein the user request is a request to perform a software coding task, and the context enhancement platform is associated with an Artificial Intelligence (“AI”) coding assistant.

### Claim 17 (depends on 16)

The method of claim 16, wherein the second LLM query is further based on at least one of: (i) a user selected code portion, and (ii) user selected open code window tabs.

### Claim 18 (depends on 14)

The method of claim 14, wherein the internal and external LLMs comprise one of: (i) a single LLM, and (ii) an external LLM different than, and independent of, the internal LLM.

### Claim 19

One or more non-transitory computer-readable media storing computer-executable instructions that, when executed by a computing system, cause the computing system to perform operations, comprising:
receiving, at a computer processor of a context enhancement platform, a user request from a user device;
constructing and outputting a first Large Language Model (“LLM”) query, from a context selector to an internal LLM, the first LLM query being designed to select relevant files names in a user data store, the user data store containing coding files with each file containing a file name;
based on a response to the first LLM query, constructing and outputting a second LLM query, from a prompt generator to an external LLM, the second LLM query including information about the user request and information about the relevant coding files; and
arranging for information about a response to the second LLM query to be transmitted to the user device.

### Claim 20 (depends on 19)

The media of claim 19, wherein information about a response to the second LLM is transmitted to the user device.

### Claim 21 (depends on 20)

The media of claim 20, wherein the second LLM query includes information about at least one of the following: (i) a user request history, (ii) instructions about how the coding files interact, and (iii) a requested output format.
