Skip to main content

Interview

This cookbook demonstrates how to use the INTERVIEW action type to conduct interviews with AI agents in a Twitter simulation. The interview functionality allows you to ask specific questions to agents and collect their responses, which is useful for research, opinion polling, and understanding agent behaviors.

Overview

The INTERVIEW action type enables you to:
  • Ask specific questions to individual agents
  • Collect structured responses from agents
  • Store interview data in the database for analysis
  • Conduct interviews alongside regular social media interactions

Key Features

  • Manual Interview Actions: Use ManualAction with ActionType.INTERVIEW to conduct interviews
  • Automatic Response Collection: The system automatically collects and stores agent responses
  • Database Storage: All interview data is stored in the trace table for later analysis
  • Concurrent Execution: Interviews can be conducted alongside other social media actions

Important Note

Do NOT include ActionType.INTERVIEW in the available_actions list when creating your agent graph. The interview action is designed to be used only manually by researchers/developers, not automatically selected by LLM agents. Including it in available_actions would allow agents to interview each other automatically, which is typically not desired behavior.

Complete Example

How It Works

1. Setup and Configuration

Important: Do NOT include ActionType.INTERVIEW in your available actions list. Interviews should only be conducted manually:
This prevents LLM agents from automatically selecting the interview action during their decision-making process. Interviews can still be conducted using ManualAction.

2. Conducting Interviews

Use ManualAction with ActionType.INTERVIEW to conduct interviews:

3. Multiple Interviews in One Step

You can interview multiple agents simultaneously:

4. Mixing Interviews with Other Actions

Interviews can be conducted alongside regular social media actions:

Data Storage and Retrieval

Database Schema

Interview data is stored in the trace table with the following structure:
  • user_id: The ID of the interviewed agent
  • action: Set to ActionType.INTERVIEW.value
  • info: JSON string containing interview details
  • created_at: Timestamp of the interview

Retrieving Interview Results

Interview Data Structure

Each interview record contains:
  • prompt: The question asked to the agent
  • interview_id: Unique identifier for the interview
  • response: The agent’s response to the question

Best Practices

1. Strategic Interview Timing

Conduct interviews at strategic points in your simulation:
  • After controversial posts to gauge reactions
  • Before and after significant events
  • At regular intervals to track opinion changes

2. Question Design

Design effective interview questions:
  • Be specific and clear
  • Avoid leading questions
  • Ask open-ended questions for richer responses