Automating CI Test Triage: Inside Salesforce's Vector Search and LLM Diagnosis Agent
How Salesforce cut test failure resolution time by 30 percent using FAISS vector clustering, asynchronous triage agents, and automated PR assignment.
On this page
In hyper-scale monorepos, a broken build is an organizational emergency that blocks hundreds of engineers from deploying code. Yet engineering audits consistently reveal that over 40% of test failures are either known flaky tests or duplicates of previously investigated infrastructure timeouts. Automating this triage classification restores developer velocity.
The Enterprise Testing Bottleneck
At enterprise scale, continuous integration faces a combinatorial explosion of failures:
[Developer Commits Code] ---> [CI Runner Fleet (100,000+ Tests)]
|
(Build Fails!)
|
v
+-------------------------------------------------------------+
| The Manual Triage Quagmire (3-5 Hours) |
| - Developer downloads 50MB raw console log |
| - Searches for "FATAL" or "AssertionError" |
| - Asks in Slack: "Is anyone else seeing DB connection drop?"|
| - Reruns build (hoping it's flaky) |
| - Manually files duplicate Jira ticket |
+-------------------------------------------------------------+
The Three-Tier AI Triage Architecture
To replace manual log inspection with deterministic automation, Salesforce designed a hybrid retrieval and reasoning pipeline:
[CI Runner Emits Failure Webhook]
|
v
+-------------------------------------------------------------+
| Log Normalization & Sanitization Engine |
| - Strips timestamps, dynamic memory addresses, thread IDs |
| - Extracts canonical error signature and stack frames |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| FAISS Vector Similarity & Deduplication |
| - Computes embedding vector via specialized CodeBERT |
| - Queries index of known historical failures & open bugs |
+-------------------------------------------------------------+
|
+--------+--------+
| |
(Match Found: >0.88 Sim) (Novel Failure: <0.88 Sim)
| |
v v
[Link Existing Ticket] +-------------------------------------+
[Flag as Known Flaky] | LLM Root-Cause Reasoning |
| - Reads PR diff + error signature |
| - Suggests code fix in PR comments |
| - Identifies responsible committer |
+-------------------------------------+
Step 1: Log Normalization and Sanitization
Raw stack traces contain dynamic noise that fools naive text matching algorithms:
- Epoch timestamps (
2026-11-14T20:41:02.194Z) - Thread identifiers (
[thread-pool-worker-42]) - Hexadecimal memory pointers (
0x7fff5fbff820) - Ephemeral port numbers (
socket:49152)
The ingestion preprocessor applies regex normalization filters, converting dynamic strings into canonical placeholders. This guarantees that two identical bugs occurring on different build machines produce an identical structural error signature.
Step 2: Vector Search Clustering via FAISS
Normalized error signatures are passed to a dense embedding model trained on code and software exceptions. The resulting vectors are indexed in FAISS (Facebook AI Similarity Search):
- High-Speed ANN Search: The system executes an $L2$ distance search across the index of historical test failures in under 15 milliseconds.
- Confidence Thresholding:
- Similarity Score $\ge 0.88$: The failure is classified as a known issue. The agent comments on the pull request with a link to the open tracker bug, automatically tagging it as non-blocking if marked as an environmental flake.
- Similarity Score $< 0.88$: The failure is classified as a novel bug introduced by the recent commit.
Step 3: LLM Root-Cause Analysis and Commit Attribution
For novel failures, an LLM reasoning agent receives a focused context window:
- The normalized failure stack trace.
- The Git diff of the author’s pull request.
- The
CODEOWNERSmapping file.
The agent generates a structured JSON triage verdict:
{
"verdict": "GENUINE_REGRESSION",
"root_cause": "NullPointerException in UserService.java line 142 due to missing null check on tenant_id parameter added in commit 4f8e2a.",
"recommended_fix": "Add `if (tenant == null) throw new InvalidTenantException();` before invoking tenant.getBillingStatus().",
"assigned_developer": "afsar@flocci.in"
}
The system posts this analysis directly as an inline review comment on the author’s GitHub PR within 60 seconds of build termination.
Do
- Strip volatile timestamps, thread IDs, and memory addresses before embedding stack traces into vector databases.
- Run AI triage agents asynchronously via webhooks to prevent holding CI worker compute resources.
- Set conservative similarity thresholds before auto-closing or auto-linking bugs to avoid misdiagnosing regressions as flakes.
Don't
- Do not feed raw 50MB build logs into LLM prompt contexts; extract and normalize only the failure stack frames.
- Avoid auto-merging pull requests based entirely on AI flake classification without human review oversight.
- Never store unredacted customer PII or sensitive API secrets embedded in test logs in vector databases.
By pairing fast vector clustering in FAISS with precise LLM contextual reasoning, Salesforce transformed continuous integration from a noisy operational headache into a self-diagnosing, automated developer productivity engine.
Frequently asked questions
Why is manual CI/CD test failure triage such a massive productivity drain?
At enterprise scale, thousands of tests run on every pull request. Distinguishing between genuine regressions, environmental infrastructure hiccups, and flaky tests requires digging through megabytes of stack traces, costing engineering teams thousands of hours weekly.
How does FAISS vector search identify recurring or duplicate test failures?
Error logs and stack traces are normalized and converted into dense vector embeddings. FAISS executes high-speed similarity search against a historical vector database of known issues, matching identical root causes across disparate test runs in milliseconds.
How does the Salesforce AI triage agent determine the correct engineer to assign?
The agent analyzes git commit histories, pull request file diffs, and code ownership CODEOWNERS mappings, correlating the diagnosed failure stack trace directly with the specific code modification that introduced the bug.
What role does asynchronous pipeline execution play in CI test triage?
CI test pipelines cannot block waiting for multiple LLM inference calls. Triage agents run asynchronously on event buses (like Kafka), ingesting failure webhooks and updating Slack or GitHub PRs out-of-band.



/* Comments */
Comments are offline right now — we reconnect automatically, nothing is lost.