Skip to content

Myth Buster

Objective

Use the AI Refinery SDK to create and run an AI system that can debunk myths. In this tutorial, you'll utilize a SearchAgent called "Finder Agent" to collect information relevant to user queries. Alongside, a CriticalThinker agent named "Critic Agent" will assess the gathered data and determine whether it supports or refutes the claims made througout the conversation. To coordinate the workflow between these agents, a SuperAgent named "Myth Busting Orchestrator" will be employed to manage and oversee the entire process.

Example Queries

  • Does cracking your knuckles cause arthritis?
  • Is it true that we can see the great wall from space?
  • Is it true that humans only use 10% of their brains?

Steps

1. Configuration file

As a first step, you simply need to create a yaml file with all the required configuration. You can customize your assistant agent in this simple YAML configuration file.

utility_agents:
  - agent_class: SearchAgent
    agent_name: Finder Agent
    agent_description: |
      The Finder Agent searches trusted online sources, such as educational institutions and 
      scientific research platforms, to evaluate user queries and statements.

  - agent_class: CriticalThinker
    agent_name: Critic Agent
    agent_description: |
      The Critic Agent evaluates the Finder Agent's response to user queries and highlights supporting 
      or contradicting details and states whether it agrees with the Finder's conclusion.
    config:
      thinking_guidelines: # The list of guidelines you want your CriticalThinker to follow.
        - "Find supporting and/or contradicting details for all claims made throught the conversation."
        - "Evaluate whether if the details you find is consistent with the claims."
        - "Come to a logical conclusion on whether with you agree or disagree with the claims based on the details."

super_agents:
  - agent_class: SuperAgent
    agent_name: Myth Busting Orchestrator
    agent_description: |
      The Myth Busting Orchestrator specializes in analyzing user queries and identifies 
      situations where common myths or misconceptions are being presented.
    config:
      goal: Detect when a user query involves a common myth or misconception by coordinating 
        the Finder Agent and the Insight Agent in completing their respective subtasks.
      steps:
        - Call the Finder Agent to search for reliable and relevant sources to answer the user's query.
        - Call the Critic Agent to analyze the Finder Agent's response and sources, and explicitly state whether it agrees with the Finder's conclusion or not.
      agent_list:
        - agent_name: Finder Agent
        - agent_name: Critic Agent
      max_steps: 6
      exit: Critic Agent
orchestrator:
  agent_list:
    - agent_name: Myth Busting Orchestrator

2. Python file

Now, you can start the development of your assistant using these few lines of code:

from dotenv import load_dotenv
from air import login, DistillerClient
import os

load_dotenv() # This loads your ACCOUNT and API_KEY from your local '.env' file

login(
    account=str(os.getenv("ACCOUNT")),
    api_key=str(os.getenv("API_KEY")),
)

distiller_client = DistillerClient()

project = "myth_buster"

distiller_client.create_project(
    config_path="config.yaml",
    project=project
)

response = distiller_client.interactive(
    project=project,
    uuid="test_user",
)