Skip to content

feat: context grounding CLI#1523

Merged
DragosBobolea merged 1 commit intomainfrom
feature/context-grounding-cli
Mar 30, 2026
Merged

feat: context grounding CLI#1523
DragosBobolea merged 1 commit intomainfrom
feature/context-grounding-cli

Conversation

@DragosBobolea
Copy link
Copy Markdown
Member

@DragosBobolea DragosBobolea commented Mar 27, 2026

Add uipath context-grounding CLI commands

Summary

Adds a new uipath context-grounding command group to the CLI, giving developers direct access to the Context Grounding (ECS) service from the terminal

Commands

uipath context-grounding list                        --folder-path <path>
uipath context-grounding retrieve --index <name> --folder-path <path>
uipath context-grounding search <query> --index <name> --folder-path <path> [--results N]
uipath context-grounding ingest --index <name> --folder-path <path>
uipath context-grounding delete --index <name> --folder-path <path> [--confirm] [--dry-run]

All commands support --folder-path, --folder-key, --format [json|table|csv], and -o <file> — consistent with uipath buckets.

Examples

# Retrieve index details
uipath context-grounding retrieve --index "Athena_Chatbot" --folder-path "Shared"

# Semantic search — same call agents make at runtime
uipath context-grounding search "who knows RPA" --index "Athena_Chatbot" --folder-path "Shared"
uipath context-grounding search "who knows RPA" --index "Athena_Chatbot" --folder-path "Shared" --results 5
uipath context-grounding search "who knows RPA" --index "Athena_Chatbot" --folder-path "Shared" --format json
uipath context-grounding search "who knows RPA" --index "Athena_Chatbot" --folder-path "Shared" -o results.json

# Re-trigger ingestion
uipath context-grounding ingest --index "Athena_Chatbot" --folder-path "Shared"

# Delete (with safety prompts)
uipath context-grounding delete --index "Athena_Chatbot" --folder-path "Shared" --dry-run
uipath context-grounding delete --index "Athena_Chatbot" --folder-path "Shared" --confirm

# Use env var to avoid repeating --folder-path
export UIPATH_FOLDER_PATH="Shared"
uipath context-grounding search "who knows RPA" --index "Athena_Chatbot"

Verified against live environment

Tested against https://alpha.uipath.com/goldenagents/DefaultTenant, Athena_Chatbot index in Shared folder:

$ uipath context-grounding retrieve --index "Athena_Chatbot" --folder-path "Shared"
# → shows index metadata: last ingested, status Successful, backed by StorageBucket

$ uipath context-grounding search "who knows RPA" --index "Athena_Chatbot" --folder-path "Shared"
# → returns Natasha Kim, Business Analyst, RPA specialist (score 0.548)

@DragosBobolea DragosBobolea changed the title feat: context grounding cli feat: context grounding cli WIP Mar 27, 2026
@DragosBobolea DragosBobolea force-pushed the feature/context-grounding-cli branch 2 times, most recently from 355f426 to 8d819e6 Compare March 27, 2026 16:28
@DragosBobolea DragosBobolea changed the title feat: context grounding cli WIP feat: context grounding CLI Mar 27, 2026
@DragosBobolea DragosBobolea force-pushed the feature/context-grounding-cli branch from 8d819e6 to 1051a63 Compare March 28, 2026 09:03
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Mar 28, 2026
@DragosBobolea DragosBobolea force-pushed the feature/context-grounding-cli branch 4 times, most recently from 905d74e to 13ddb2f Compare March 28, 2026 10:18
@DragosBobolea DragosBobolea enabled auto-merge (squash) March 30, 2026 07:34
Adds a new command group for working with Context Grounding (ECS) indexes
directly from the terminal — the same semantic search agents use at runtime.

Commands
--------
  uipath context-grounding list     --folder-path PATH
  uipath context-grounding retrieve --index NAME --folder-path PATH
  uipath context-grounding search   QUERY --index NAME --folder-path PATH
  uipath context-grounding ingest   --index NAME --folder-path PATH
  uipath context-grounding delete   --index NAME --folder-path PATH

All commands accept --folder-path / --folder-key, --format [json|table|csv],
and -o FILE, consistent with `uipath buckets` and `uipath assets`.
search also accepts --limit (min 1, default 10) and --threshold (optional).

Service changes (uipath-platform)
----------------------------------
- Add list() / list_async() to ContextGroundingService (GET /ecs_/v2/indexes
  without $filter; retrieve() uses the same endpoint with Name eq filter)
- Replace bare list[T] annotations in the service with List[T] from typing
  to fix a class-scope shadowing issue: naming a method `list` causes Python
  to resolve the built-in as the method when evaluating later annotations
- list and search table output projects to key columns; full objects for JSON/CSV

CLI changes (uipath)
--------------------
- Register `context-grounding` in _LAZY_COMMANDS with hyphen->underscore fix
  for getattr (context-grounding -> context_grounding)
- --index named option on all commands that take an index name
- --limit (min 1, default 10) and --threshold (optional float) for search
- ingest and delete guard against index.id=None to avoid a silent SDK no-op
- ingest fast-fails via index.in_progress_ingestion() before the HTTP call
- Error handling mirrors cli_buckets.py: HTTPStatusError 404 and SDK bare
  Exception route through handle_not_found_error()
- _handle_retrieve_error() typed -> NoReturn for correct control-flow inference
- All exceptions from delete_index()/ingest_data() surface as ClickException

Files
-----
  packages/uipath-platform/.../context_grounding/_context_grounding_service.py
  packages/uipath-platform/tests/services/test_context_grounding_service.py
  packages/uipath/src/uipath/_cli/__init__.py
  packages/uipath/src/uipath/_cli/services/__init__.py
  packages/uipath/src/uipath/_cli/services/cli_context_grounding.py   (new)
  packages/uipath/tests/cli/contract/test_sdk_cli_alignment.py
  packages/uipath/tests/cli/integration/test_context_grounding_commands.py (new)

Verified against alpha.uipath.com / goldenagents / DefaultTenant.
@DragosBobolea DragosBobolea force-pushed the feature/context-grounding-cli branch from 13ddb2f to b9a8409 Compare March 30, 2026 07:34
@DragosBobolea DragosBobolea merged commit 488dcbf into main Mar 30, 2026
92 of 93 checks passed
@DragosBobolea DragosBobolea deleted the feature/context-grounding-cli branch March 30, 2026 07:36
pateljay43 added a commit that referenced this pull request Mar 30, 2026
…upport, and full command coverage

Rewrites the context-grounding CLI introduced in #1523 with:

- All identifiers as explicit named options (--index-name, --index-id,
  --task-name, --task-id, --query, --output-file) — no ambiguous positionals
- Dual index flow: --index-name + --folder-path for regular indexes,
  --index-id for ephemeral indexes
- New commands: create, create-ephemeral, source-schema, deep-rag (start/retrieve),
  batch-transform (start/retrieve/download)
- Uses unified_search (v1.2) instead of deprecated search method
- Uses list_indexes instead of list (avoids shadowing builtin)
- Uses convenience methods (ingest_by_name, delete_by_name) instead of
  two-step retrieve + operate pattern
- SDK start_deep_rag/start_batch_transform accept both index_name and
  index_id natively — no branching needed in CLI
- source-schema command generates JSON templates from Pydantic models at runtime
- Updated contract tests (11 passing) and integration tests (47 passing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants