Tool Call rag_select
Selects one candidate from the result of the last rag_retrieval and stores a link to it in the current case.
See Tool Calls for the general concept.
When to use
Use rag_select after rag_retrieval, only if the agent has decided that a candidate really is the match you are looking for. If no candidate fits, the tool is not called - the missing link is the result.
Arguments
| Argument | Required | Description |
|---|---|---|
candidate |
yes | The number of the candidate, exactly as shown in the result of rag_retrieval |
refField |
yes | Field of the current case to store the link in. Give the exact name in your prompt |
What happens
- The agent passes only the number of the candidate. The platform looks up the case behind that number and stores the link in
refField. The agent never sees or writes an ID. - A second call replaces the previous selection.
- A number that does not exist in the last search result is rejected with an error, and the agent can correct it.
Typical flow
rag_retrieval → numbered candidates
│
▼
The agent compares the candidates with the current case
│
▼
rag_select(candidate = 2, refField = "order.recall.id")
│
▼
order.recall.id contains the link to candidate 2
Prompt example
STEP 4 - Decide
- If at least one candidate matches, this is a repeat order. Choose the best match: the most
recent matching candidate (by "created"). Call the tool "rag_select" with its number as
"candidate" and the refField "order.recall.id".
- If no candidate matches, this is not a repeat order. Do not call "rag_select".
Rules:
- Never write or repeat an ID. Candidates are addressed by their number only.
Tips
- Tell the agent how to choose when several candidates match (e.g. the most recent one by
created). - Decide in the prompt what to write into other fields in both cases - with and without a selection - e.g. with
update_workitem. - The link can be used in the form like any other reference field, e.g. to show the earlier order next to the current one.