feat(context-grounding): support Semantic ephemeral indexes and search by index id - #1921
Open
mmotasim-uipath wants to merge 1 commit into
Open
mmotasim-uipath wants to merge 1 commit into
mmotasim-uipath wants to merge 1 commit into
Conversation
…h by index id Add EphemeralIndexUsage.SEMANTIC so an ephemeral index can be built from attachments for plain semantic search, and unified_search_by_id(_async) to search it: ephemeral indexes have no name, and unified_search looks the index up by name first. CLI: create-ephemeral accepts --usage Semantic (PDF, TXT); search accepts --index-id as an alternative to --index-name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The ID-search path silently ignores an accepted option, and bundled CLI and SDK references remain stale.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Adds Semantic ephemeral indexes and direct index-ID search to Context Grounding.
Changes:
- Adds
EphemeralIndexUsage.SEMANTICand sync/async ID-based search APIs. - Extends CLI creation/search commands with Semantic usage and
--index-id. - Adds tests and bumps package versions.
| File | Description |
|---|---|
packages/uipath/uv.lock |
Updates locked package versions. |
packages/uipath/tests/cli/integration/test_context_grounding_commands.py |
Tests Semantic creation and ID search. |
packages/uipath/tests/cli/contract/test_sdk_cli_alignment.py |
Exempts routed ID parameter. |
packages/uipath/src/uipath/_cli/services/cli_context_grounding.py |
Extends Context Grounding CLI. |
packages/uipath/pyproject.toml |
Bumps SDK and platform dependency versions. |
packages/uipath-platform/uv.lock |
Updates the locked platform version. |
packages/uipath-platform/tests/services/test_context_grounding_service.py |
Tests Semantic requests and ID searches. |
packages/uipath-platform/src/uipath/platform/context_grounding/context_grounding.py |
Adds Semantic enum value. |
packages/uipath-platform/src/uipath/platform/context_grounding/_context_grounding_service.py |
Implements direct ID-based search APIs. |
packages/uipath-platform/pyproject.toml |
Bumps platform package version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
515
to
+517
| client = ServiceCommandBase.get_client(ctx) | ||
| if index_id: | ||
| return client.context_grounding.unified_search_by_id( |
Comment on lines
+1932
to
+1933
| @traced(name="contextgrounding_unified_search_by_id", run_type="uipath") | ||
| def unified_search_by_id( |
Comment on lines
+450
to
+452
| @click.option("--index-name", help="Name of the index to search") | ||
| @click.option( | ||
| "--index-id", help="ID of the index to search (ephemeral Semantic indexes)" |
|
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.





Summary
Ephemeral (JIT) indexes can only be created for
DeepRAGorBatchRAGthrough the SDK. The service also acceptsusage: "Semantic", which gives a plain semantic-search index over the attached files, but the SDK has no way to create one or to search it afterwards.EphemeralIndexUsage.SEMANTIC = "Semantic":create_ephemeral_index(usage=EphemeralIndexUsage.SEMANTIC, attachments=[...])now works.unified_search_by_id/unified_search_by_id_async: search an index by its id.unified_searchresolves the index by name first, and ephemeral indexes have none. The new methods reuse_unified_search_specand skip the name lookup. Callers pollretrieve_by_iduntillastIngestionStatusisSuccessful, as the CLI help already tells them to for ephemeral indexes.create-ephemeral --usage Semantic(PDF, TXT), andsearch --index-id <id>as an alternative to--index-name(mutually exclusive, likeretrieveanddeep-rag start).The change is additive: no existing signature changes.
uipath-platformgoes to 0.2.34 anduipathto 2.14.28, with the platform pin raised to match.Why
We use this for prior-auth chart reading: upload a patient's chart as a job attachment, build a Semantic ephemeral index over just that file, then fetch the whole chart with one search (
threshold=0.0, largenumber_of_results). One index per document means other documents can't come back, which a shared bucket index can't guarantee. Until now this needed raw HTTP calls to/ecs_/v2/indexes/createephemeraland/ecs_/v1.2/search/{id}.Testing
Semantic(request body), andunified_search_by_idsync + async (a single request, no name lookup, correct body and user agent). CLI tests for--usage Semantic,search --index-id, and the name/id validation. The SDK/CLI contract test exemptssearch --index-idthe same way it already exemptsretrieve --index-id.ruff check,ruff format --checkandmypy src testsare clean.uipath-platformcontext-grounding + HITL tests: 263 passed.uipathcontext-grounding CLI + contract tests: 74 passed.create_ephemeral_index(SEMANTIC)on a one-page PDF went fromInProgresstoSuccessfulin 24 s, andunified_search_by_idreturned the page. With raw calls to the same endpoints, a 23-page scanned PDF took about 180 s to ingest and came back as one chunk per page.Open question for Context Grounding owners
Is
Semantica supported, stableusagevalue for ephemeral indexes? It works in our tenant today, but it isn't documented. If it isn't meant to be public, say so and I'll close this.🤖 Generated with Claude Code