Repository navigation
feat(agent): let the LLM pick the folder for semantic context searches [PC-5304] - #1176
Open
tudormatei1 wants to merge 1 commit into
Open
tudormatei1 wants to merge 1 commit into
tudormatei1 wants to merge 1 commit into
Conversation
Agents could limit a Context Grounding search to one folder only with a fixed value or an agent input set at job start. When a semantic context's folder path prefix is set to dynamic, the tool now takes an optional folder_path_prefix argument, so the LLM can scope each search to a folder, or leave it out to search the whole index. The argument's description is the one the author wrote in Agent Builder, with a default when there is none. It is advertised as a plain string, but a null or blank value is accepted and means no filter, so a model sending null does not fail the job. Static and argument prefixes work as before and win over anything the LLM sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tudormatei1
force-pushed
the
feat/PC-5304-dynamic-folder-prefix
branch
from
November 4, 2026 12:41
52b542f to
111c3b2
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The reported end-to-end search returned HTTP 400, leaving scoped retrieval against a populated index and the folder-path format’s leading-slash requirements unverified.
No open issues 🎉
What changed in this PR
Adds per-search folder selection to semantic context tools, allowing agents to search different Context Grounding folders within one session.
Changes:
- Adds an optional dynamic
folder_path_prefixargument with author-provided or default guidance, while preserving static and argument prefix precedence. - Adds tests for schema generation, per-call folder selection, and omitted, blank, or null values.
- Bumps the package version to
0.18.52.
| File | Description |
|---|---|
uv.lock |
Updates the locked project version to 0.18.52. |
tests/agent/tools/test_context_tool.py |
Tests dynamic folder schemas and search scoping through tool invocation. |
src/uipath_langchain/agent/tools/context_tool.py |
Adds the dynamic folder argument and resolves it for semantic searches. |
pyproject.toml |
Updates the package version to 0.18.52. |
Review effort: Balanced
|
This branch has not been deployed
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.



Agents can now let the LLM choose the Context Grounding folder on each search. Before this, a semantic context could only be scoped to one folder with a fixed value or an agent input set at job start. That doesn't work when one session asks about several folders, for example one folder per patent docket, where the docket number only exists in the folder name.
When a semantic context's
folderPathPrefix.variantisdynamic, the tool gets an optionalfolder_path_prefixargument:"type": "string", butnulland blank values are accepted and mean "search the whole index". Some models sendnullfor optional arguments, and that shouldn't fail the job.Testing
TestDynamicFolderPathPrefixruns the real tool, and its wrapper for argument queries, and checks thescopesent tounified_search_async. It covers: the schema, the author's description and the default, a folder scoping the search for dynamic, static and argument queries, two calls with different folders, andNone,""andnullsearching the whole index.End to end on alpha, with Studio Web, a local robot on this branch, and an index with one folder per docket: I asked about a docket that the unscoped top 3 never returns. The LLM sent
folder_path_prefix: "Dockets/D102"and got that docket's file. With the deployed runtime, the same question found nothing.Checked against a real index how Context Grounding matches the folder:
/is optional;Reports/20matches bothReports/2023andReports/2024;/**returns nothing.The default description's example,
Reports/2024, fits that.Rollout
EnableContextGroundingDynamicFolderPathPrefix(UiPath/Agents#6804, UiPath/gitops-centralized-cluster#611672), which stays off in every environment until this runtime is there.uipath-agentspinsuipath-langchainexactly, so its bump to 0.18.56 follows in a separate PR once this is released.🤖 Generated with Claude Code