CrewAI + GroundTruth Execute Demo

See how a CrewAI agent uses the GroundTruthExecuteTool to verify every response against a knowledge base before sending it to a customer.

How It Works

Customer asks a question

via email, Slack, Zendesk, etc.

CrewAI agent drafts a reply

using LLM + internal tools

GroundTruth verifies & decides

approve, block, or escalate

If escalated, await approval

agent polls until resolved

CrewAI integration (Python)

from crewai import Agent, Task, Crew
from groundtruth.crewai import (
    GroundTruthExecuteTool,
    GroundTruthAwaitApprovalTool,
    GroundTruthSessionHistoryTool,
)

# The tools wrap the Execute, Await Approval, and Session History APIs
gt_execute = GroundTruthExecuteTool(api_key="hg_sk_...", session_id="session-1")
gt_await   = GroundTruthAwaitApprovalTool(api_key="hg_sk_...")
gt_history = GroundTruthSessionHistoryTool(api_key="hg_sk_...", session_id="session-1")

support_agent = Agent(
    role="Customer Support Agent",
    goal="Answer customer questions accurately",
    tools=[gt_execute, gt_await, gt_history],
)

# When the agent calls gt_execute, GroundTruth:
#   1. Verifies the response against your knowledge base
#   2. Returns claim-level detail (what failed and why)
#   3. Evaluates risk-score policies → APPROVED | BLOCKED | ESCALATED
# If ESCALATED, the agent calls gt_await to poll for the human decision.
# gt_history lets the agent see past decisions in this session.

Below you can simulate what the agent sees — pick a scenario, edit the response, and hit Execute.

API Configuration

Scenario

Execute Input

No results yet

Simulate what happens when a CrewAI agent calls GroundTruthExecuteTool — pick a scenario and click Execute.

Session History

Query past executions for this demo session — shows what a downstream agent sees via GroundTruthSessionHistoryTool

Click "Load Session History" after running a few scenarios to see the full session timeline.