UiPath Documentation
uipath-cli
latest
false

UiPath CLI user guide

最終更新日時 2026年5月7日

uip agent context

uip agent context manages context resources on an agent project — the RAG (retrieval-augmented generation) index bindings that the agent consults at runtime. Each context is a named reference to an index, plus a retrieval mode and scoring parameters. The command writes directly to the agent project on disk (purely local — no login required).

Synopsis

uip agent context add    <name> --index <indexName>
                                [--retrieval-mode <mode>] [--threshold <n>] [--result-count <n>]
                                [--path <dir>]
uip agent context list                                    [--path <dir>]
uip agent context remove <name>                           [--path <dir>]
uip agent context add    <name> --index <indexName>
                                [--retrieval-mode <mode>] [--threshold <n>] [--result-count <n>]
                                [--path <dir>]
uip agent context list                                    [--path <dir>]
uip agent context remove <name>                           [--path <dir>]

All uip agent context subcommands honor the global options (--output, --output-filter, --log-level, --log-file). Exit codes follow the standard contract.

uip agent context add

Add a RAG context resource to the agent.

引数

  • <name> (required) — Context resource name. Used for later removal (context remove <name>).

オプション

フラグ既定 (Default)Required目的
--index <indexName>Index name to retrieve from.
--retrieval-mode <mode>semanticRetrieval mode. One of: semantic, structured, deeprag, batchtransform.
--threshold <n>0Retrieval score threshold (numeric). Values below this cutoff are discarded.
--result-count <n>3Number of results to retrieve per query (integer).
--path <path>.Path to the agent project directory.

Invalid numeric inputs for --threshold or --result-count fail with a validation error.

# Semantic RAG with defaults (threshold 0, 3 results)
uip agent context add KnowledgeBase --index docs-index --path ./my-agent

# Tighter recall: higher threshold, more results
uip agent context add KnowledgeBase \
  --index docs-index \
  --retrieval-mode semantic \
  --threshold 0.7 \
  --result-count 5

# Structured retrieval over a different index
uip agent context add Tickets \
  --index ticket-index \
  --retrieval-mode structured
# Semantic RAG with defaults (threshold 0, 3 results)
uip agent context add KnowledgeBase --index docs-index --path ./my-agent

# Tighter recall: higher threshold, more results
uip agent context add KnowledgeBase \
  --index docs-index \
  --retrieval-mode semantic \
  --threshold 0.7 \
  --result-count 5

# Structured retrieval over a different index
uip agent context add Tickets \
  --index ticket-index \
  --retrieval-mode structured

Data shape (--output json)

{
  "Code": "AgentContextAdd",
  "Data": {
    "Status": "Context added",
    "Name": "KnowledgeBase",
    "Index": "docs-index",
    "Mode": "semantic",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010"
  }
}
{
  "Code": "AgentContextAdd",
  "Data": {
    "Status": "Context added",
    "Name": "KnowledgeBase",
    "Index": "docs-index",
    "Mode": "semantic",
    "Id": "a1b2c3d4-0000-0000-0000-000000000010"
  }
}

Id is a generated UUID stamped into the resource. Use either the Name or the Id with context remove.

uip agent context list

Enumerate the context resources configured on the agent.

オプション

フラグ既定 (Default)目的
--path <path>.Path to the agent project directory.

uip agent context list --path ./my-agent
uip agent context list --path ./my-agent

Data shape (--output json)

{
  "Code": "AgentContextList",
  "Data": [
    {
      "Name": "KnowledgeBase",
      "Index": "docs-index",
      "Mode": "semantic",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}
{
  "Code": "AgentContextList",
  "Data": [
    {
      "Name": "KnowledgeBase",
      "Index": "docs-index",
      "Mode": "semantic",
      "Id": "a1b2c3d4-0000-0000-0000-000000000010"
    }
  ]
}

Empty projects return Data: { "Message": "No contexts configured" }.

uip agent context remove

Remove a context resource.

引数

  • <name> (required) — Context name or ID.

オプション

フラグ既定 (Default)目的
--path <path>.Path to the agent project directory.

uip agent context remove KnowledgeBase --path ./my-agent
uip agent context remove KnowledgeBase --path ./my-agent

Data shape (--output json)

{
  "Code": "AgentContextRemove",
  "Data": {
    "Status": "Context removed",
    "Name": "KnowledgeBase"
  }
}
{
  "Code": "AgentContextRemove",
  "Data": {
    "Status": "Context removed",
    "Name": "KnowledgeBase"
  }
}

A missing context fails with Context "<name>" not found and exit code 1.

参照

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得