Agentic Workflows

Multi-step reasoning with tool calling

Multi-step reasoning where agents use tools to complete tasks.

Agentic vs Non-Agentic

Non-agentic (standard RAG):

  • Retrieve documents → generate response

  • Single LLM call

  • No external actions

Agentic (with tools):

  • Retrieve documents → decide if tool needed → call tool → synthesize result

  • Multiple LLM calls (planning, execution, synthesis)

  • Can execute actions (API calls, calculations, code)

Requires: Cypress RAG strategy

Tool Types

Built-in tools:

  • search_knowledge_base(query): Recursive retrieval

  • calculate(expression): Math evaluation (Python eval)

Custom tools (Enterprise):

  • api_call(endpoint, method, params): HTTP requests to your APIs

  • run_code(script): Server-side JavaScript execution (sandboxed)

Configure: Agents → [Agent] → Configuration → Tools tab

Example Use Case

Problem: "When is my next payment date?"

Non-agentic response: "Payment dates are on the 1st and 15th of each month."

Agentic response:

  1. Agent retrieves payment schedule from docs

  2. Calls calculate tool with current date

  3. Determines next date: "January 15, 2024"

  4. Responds: "Your next payment date is January 15, 2024."

Observable behavior: Response shows "Tools used: calculate" in debug panel

Enable Agentic Workflows

Location: Agents → [Agent] → Configuration → Advanced Settings

  1. Toggle Agentic Workflow → On

  2. Select tools from list (checkboxes)

  3. Configure tool parameters (if needed)

  4. Click Save

Requirements:

  • RAG strategy must be Cypress

  • Enterprise plan (custom tools)

  • API endpoints must be accessible from Twig servers

Latency impact: +1-3s per tool call (depends on tool execution time)

Tool Configuration

Custom API tool example:

Observable behavior: Agent detects need, calls API, incorporates result in response

When to Use Agentic Workflows

Use when:

  • Need real-time data (balances, statuses, dates)

  • Require calculations or logic

  • Must execute actions (create ticket, send email)

  • Multi-step reasoning needed

Don't use when:

  • Simple document retrieval sufficient

  • Speed is critical (adds latency)

  • No dynamic data needed

  • Budget constrained (costs more)

Constraints

  • Cypress strategy only (Redwood/Cedar don't support tools)

  • Max 5 tool calls per query

  • Tool timeout: 30 seconds

  • No database writes (read-only APIs recommended)

  • Sandboxed execution (limited Node.js APIs for custom code)

Rate limits: Same as standard queries (100 req/min Execute scope)

Last updated