Skip to content

feat: context grounding CLI#1523

Open
DragosBobolea wants to merge 1 commit intomainfrom
feature/context-grounding-cli
Open

feat: context grounding CLI#1523
DragosBobolea wants to merge 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 3 times, most recently from 9fa042e to 905d74e Compare March 28, 2026 10:15
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 905d74e to 13ddb2f Compare March 28, 2026 10:18
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.

1 participant