IP Library › Granted Patent US 12,487,818
Granted Patent B2
US 12,487,818 · App. 18/141,104 · Granted Dec 2, 2025

Interactive chatbot documentation

Inventors: Amine El Hattami (Montreal, CA); Christopher Joseph Pal (Montreal, CA)
Assignee: ServiceNow, Inc.
G06F8/73G06F16/3329G06F8/30G06F8/33G06F8/51G06F8/63
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,487,818
App. No.
18/141,104
Granted
Dec 2, 2025
Kind
B2
Abstract

Metadata associated with program code documentation is identified, wherein the program code documentation is associated with corresponding program code. A natural language question regarding the corresponding program code is obtained via a virtual agent. A response to the natural language question is determined based on the metadata using one or more trained machine learning models. The response to the natural language question is provided to the virtual agent.

Claims (44)

1 . A method, comprising:

performing a static code analysis on source code, the static code analysis to determine a number of execution paths through the source code;

determining a complexity associated with program documentation of the source code based on the number of execution paths, wherein determining the complexity associated with the program documentation of the source code comprises automatically evaluating a control-flow graph of the source code, wherein nodes of the control-flow graph correspond to groups of commands of the source code, and wherein edges of the control-flow graph correspond to execution orderings of the groups of commands;

obtaining, via a virtual agent, a natural language question regarding the source code;

determining a response to the natural language question based on a neural ranking model and the complexity associated with the program documentation and the source code, wherein the neural ranking model returns a ranked list of information specifying one or more source code examples; and

providing, to the virtual agent, the response to the natural language question.

2 . The method of claim 1 , wherein determining the complexity includes determining a complexity of a function of the source code that is included in the program documentation.

3 . The method of claim 2 , wherein determining the complexity includes determining: (i) a first complexity score associated with a first section of the program documentation and (ii) a second complexity score associated with a second section of the program documentation, and wherein the first complexity score is different from the second complexity score.

4 . The method of claim 2 , wherein the program documentation includes prerequisite knowledge associated with the function included in the program documentation.

5 . The method of claim 1 , further comprising:

obtaining user information via the virtual agent, wherein the user information comprises one or more of:

a level of expertise, a prior knowledge, an education level, or an age-group.

6 . The method of claim 1 , wherein the program documentation includes information regarding the source code or contents specifying at least one or more source code examples.

7 . The method of claim 6 , wherein the natural language question is a part of a chatbot conversation.

8 . The method of claim 7 , further comprising:

providing the chatbot conversation to a retrieval model to retrieve data from the program documentation; and

determining, using one or more trained machine learning models, the response to the natural language question based on the retrieved data.

9 . The method of claim 8 , wherein the retrieved data comprises one or more of: at least a portion of the information regarding the source code or at least a portion of the contents specifying the source code examples.

10 . The method of claim 8 , wherein the one or more trained machine learning models comprise a trained machine learning model used to perform a dialogue task dynamically tailored for one or more of: a level of expertise, a prior knowledge, an education level, or an age-group.

11 . The method of claim 8 , wherein the one or more trained machine learning models comprise a trained machine learning model used to perform a code generation task dynamically tailored for one or more of: a level of expertise or a prior knowledge.

12 . The method of claim 8 , wherein the one or more trained machine learning models comprise a trained machine learning model used to perform a code summarization task dynamically tailored for one or more of: a level of expertise or a prior knowledge.

13 . The method of claim 8 , wherein the one or more trained machine learning models comprise a trained machine learning model used to perform a document generation task dynamically tailored for one or more of: a level of expertise or a prior knowledge.

14 . The method of claim 8 , wherein the one or more trained machine learning models comprise a trained machine learning model used to perform one or more of: a dialogue task, a code generation task, or a code summarization task, and wherein the response to the natural language question comprises one or more of: a piece of dialogue generated by the dialogue task, a piece of code generated by the code generation task, or a code summarization generated by the code summarization task.

15 . The method of claim 1 , wherein determining the complexity associated with the program documentation of the source code comprises determining a cyclomatic complexity of the source code.

16 . A system, comprising:

memory;

instructions in the memory; and

one or more processors configured to execute the instructions to:

perform a static code analysis on source code, the static code analysis to determine a number of execution paths through the source code;

determine a complexity associated with program documentation of the source code based on the number of execution paths, wherein determining the complexity associated with the program documentation of the source code comprises automatically evaluating a control-flow graph of the source code, wherein nodes of the control-flow graph correspond to groups of commands of the source code, and wherein edges of the control-flow graph correspond to execution orderings of the groups of commands;

obtain, via a virtual agent, a natural language question regarding the source code;

determine a response to the natural language question based on a neural ranking model and the complexity associated with the program documentation and the source code, wherein the neural ranking model returns a ranked list of information specifying one or more source code examples; and

provide, to the virtual agent, the response to the natural language question.

17 . The system of claim 16 , wherein the natural language question is a part of a chatbot conversation, and wherein the one or more processors are further configured to execute the instructions to:

provide the chatbot conversation to a retrieval model to retrieve data from the program documentation; and

determine, using one or more trained machine learning models, the response to the natural language question based on the retrieved data.

18 . The system of claim 16 , wherein determining the complexity associated with the program documentation of the source code comprises determining a cyclomatic complexity of the source code.

19 . A computer program product embodied in a non-transitory computer readable medium and comprising computer instructions for:

performing a static code analysis on source code, the static code analysis to determine a number of execution paths through the source code;

determining a complexity associated with program documentation of the source code based on the number of execution paths, wherein determining the complexity associated with the program documentation of the source code comprises automatically evaluating a control-flow graph of the source code, wherein nodes of the control-flow graph correspond to groups of commands of the source code, and wherein edges of the control-flow graph correspond to execution orderings of the groups of commands;

obtaining, via a virtual agent, a natural language question regarding the source code;

determining a response to the natural language question based on a neural ranking model and the complexity associated with the program documentation and the source code, wherein the neural ranking model returns a ranked list of information specifying one or more source code examples; and

providing, to the virtual agent, the response to the natural language question.

20 . The computer program product of claim 19 , wherein determining the complexity associated with the program documentation of the source code comprises determining a cyclomatic complexity of the source code.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 13, 2023
From: EL HATTAMI, AMINE; PAL, CHRISTOPHER JOSEPH
To: SERVICENOW, INC.
Reel/Frame 064247/0343 →
Continuity (1)
Related Publication 20240362019A1 · Oct 31, 2024
References Cited (11)
US 20190034522A1 · Kim · 2019 [cited by examiner]
US 20190294728A1 · Kohlmeier · 2019 [cited by examiner]
US 20190317885A1 · Heinecke · 2019 [cited by examiner]
US 20200133662A1 · Smith · 2020 [cited by examiner]
US 20230040412A1 · Ramsl · 2023 [cited by examiner]
US 20230168885A1 · Youngblood · 2023 [cited by examiner]
US 20230393832A1 · Touati · 2023 [cited by examiner]
US 20240020115A1 · Qian · 2024 [cited by examiner]
US 20240249072A1 · Ting · 2024 [cited by examiner]
US 20240273123A1 · Costa · 2024 [cited by examiner]
US 20240402999A1 · Chen · 2024 [cited by examiner]