Graine AI

Tools, transfers and knowledge

Let an AI reply step look things up or act through your tools, make a step call a tool, end the call or hand it to a person, and answer from your own documents.

An AI reply step can do more than talk. It can call your systems through the agent's tools, end the call with a goodbye of its own, hand the caller to a person, and answer from documents you uploaded. Fixed lines and branches do none of these: a fixed line only says its line, and a branch never speaks.

The Tools area

Tools, one of the builder's four areas, lists the agent's tools: requests to your own servers that the AI can make during a call, set up the same way as for any agent. Each tool shows its name and description, and where it is offered:

  • Every step: the AI can use it on every AI reply step;
  • Chosen steps: only on the steps you pick. Fewer tools on a step means fewer wrong calls to them.

A tool limited to a step follows the step when you rename it. If you delete the only step a tool was limited to, the tool goes back to every step. A tool limited to steps that no longer exist says so on its card.

Add or edit tools opens the agent's tool editor, where a tool's request, its inputs and its Pre-call Message (said while the request runs) are set. The editor saves on its own, so it needs the agent saved once, and it asks you to save or discard tool changes made in the builder first. To edit the tools as text instead, use Settings › Advanced › Raw tools; that goes into your draft and is kept with Save.

Make a step use a tool

On its own, the AI decides when a tool is worth calling. To make a step call one when it replies, open the step's Fine-tune this step and set Uses a tool: End the call, Transfer the call when the agent has call transfer, or any of the agent's tools.

  • The AI calls that tool when it replies on the step, once each time the call arrives there, and then speaks from what the tool returned.
  • A step can use a tool that is limited to other steps: the tool is offered on this step too.
  • If the step's instructions use a variable that is also one of the tool's required inputs, and the call has no value for it, the step replies without calling the tool, rather than calling it with something made up.
  • On a fixed line or a branch, a tool does nothing. The step's panel says so and offers Remove it, and Check warns about it.

On the canvas, a step that uses a tool wears the Uses a tool badge (unless another badge outranks it) and a chip naming the tool.

What a tool's answer does

The AI reads the answer and speaks from it. The decision model reads it too, when it chooses the step's next path. And when a tool answers with a JSON object, each of its top-level fields joins the call's data under its own name, so a rule on the next step can test it and later text can say it. See Values picked up during the call.

End the call from a step

Set an AI reply step's Uses a tool to End the call and it becomes a closing step. When the call reaches it, the AI is told this is its last turn: it gives the step's closing message, without asking anything, and the call hangs up once the message has played. Write what the goodbye should cover in the step's instructions, or show it in a sample reply.

  • The goodbye is the step's. The agent's Goodbye message is not said after it.
  • Talking over it. By default the goodbye plays to the end. With Let the caller talk over a closing step on, in Settings › On the call, a caller who speaks over it stops the hang-up: the step answers them, and ends the call when they are done.
  • Answering machines always hear the whole goodbye.

A fixed line can close a call too, word for word: see Hang up after the line. Every other way a call can end is on How a call ends.

Only your closing steps

The setting The agent hangs up when the conversation is over, in Settings › On the call, lets the agent end a call on any step once it judges the conversation finished. Switch it off when calls should end only on the closing steps you built.

Hand the call to a person

  1. In Tools, on the Call transfer card, choose Add call transfer. The tool editor opens with the transfer tool added; save it there.
  2. On the step that should transfer, open Fine-tune this step and set Uses a tool to Transfer the call.
  3. In that step's instructions, say where to transfer: a phone number with its country code, such as +91 98765 43210, or a variable such as {transfer_to} that each call fills in.

For example:

Tell the caller you're connecting them to a specialist who can help with pricing,
then transfer the call to {transfer_to}.

With a variable, give it a default in Variables, or send it with every call: when it has no value, the step replies without transferring. While the transfer connects, the agent says the tool's Pre-call Message. It comes written in Hindi; change it in the tool editor to suit your agent's language.

Remove call transfer on the same card takes the tool off your draft, and Save keeps that. A step still set to Transfer the call then stops the save, as any step using a tool the agent no longer has does. A transfer needs a phone line, so try it with a phone call from Test.

Answer from your documents

A knowledge base lets the AI answer from your own documents instead of guessing. Before each reply on an AI reply step, the passages that best match the caller's latest words are added to what the AI reads.

  • For the whole agent: Settings › Knowledge. Choose one of the workspace's libraries as the Document library, and how many Passages to read before each answer, from 1 to 20 (10 by default).
  • For one step: Fine-tune this step › Knowledge base on an AI reply step. Attach a library, then Attach another library if the step needs more than one, and set its own Passages to read. On that step, its libraries replace the agent's. A step without its own uses the agent's.

A step that answers questions about pricing, for instance, can read only your price list while the rest of the call uses your general help documents. Libraries themselves are managed under Knowledge base in the sidebar; with none yet, the pickers say so.

If a library can't be reached during a call, the step still replies, without passages.

On your website and in your app

When the agent runs on your website or in your app, its widgets and in-app actions are offered on every AI reply step as well, never on a fixed line or a branch. See On your website and in your app.

Next: Events.

On this page