[Security assistant] Remove title creation step from graph#226864
Merged
stephmilovic merged 7 commits intoelastic:mainfrom Jul 8, 2025
Merged
[Security assistant] Remove title creation step from graph#226864stephmilovic merged 7 commits intoelastic:mainfrom
stephmilovic merged 7 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Contributor
💚 Build Succeeded
Metrics [docs]
History
|
KDKHD
approved these changes
Jul 8, 2025
Member
KDKHD
left a comment
There was a problem hiding this comment.
Tested this change locally and it is working well! There is a noticeable latency improvement!
Contributor
|
Starting backport for target branches: 8.18, 8.19, 9.0, 9.1 |
Contributor
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
stephmilovic
added a commit
to stephmilovic/kibana
that referenced
this pull request
Jul 8, 2025
…26864) (cherry picked from commit 2278db5) # Conflicts: # x-pack/solutions/security/plugins/elastic_assistant/docs/img/default_assistant_graph.png # x-pack/solutions/security/plugins/elastic_assistant/docs/img/default_attack_discovery_graph.png # x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts
stephmilovic
added a commit
to stephmilovic/kibana
that referenced
this pull request
Jul 8, 2025
…26864) (cherry picked from commit 2278db5) # Conflicts: # x-pack/solutions/security/plugins/elastic_assistant/docs/img/default_assistant_graph.png # x-pack/solutions/security/plugins/elastic_assistant/docs/img/default_attack_discovery_graph.png # x-pack/solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph/graph.ts
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kertal
pushed a commit
to kertal/kibana
that referenced
this pull request
Jul 25, 2025
kertal
pushed a commit
to kertal/kibana
that referenced
this pull request
Jul 25, 2025
…lastic#226864)" This reverts commit 2278db5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Having the
generateChatTitleas part of the graph caused the time to first token to be delayed by 1s. Removing the step from the graph and calling it async without await resolves the issue.Running the assistant with the input
hion a new chat 10 times off of main resulted in an average runtime for 3.00s. Running the assistant with the inputhion a new chat 10 times off of this branch resulted in an average runtime for 2.05s.Why not parallel in graph?
Previously, the
generateChatTitlestep was part of the conversation graph execution chain, branching fromgetPersistedConversation. While it was intended to run in parallel to the main agent response path, it internally triggered a model call via the graph’s own execution infrastructure. Because LangGraph serializes graph steps and model invocations within a single graph execution, this caused the graph to block at this point — waiting for the title generation to complete before continuing to the agent step.Moving this step to a
RunnableParallelwas not a viable option, as the model call withingenerateChatTitlewould still execute through the same LangGraph graph runner and event loop, meaning the parent graph execution would remain blocked until all child runnables completed. Since LangGraph JS does not currently support true parallel graph branches that run independently within the same orchestrated execution, this approach would not resolve the blocking behavior.