> ## Documentation Index
> Fetch the complete documentation index at: https://docs.expectedparrot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI-led interviews with people

> Personalize AI interview guides and combine conversations with structured survey questions.

An AI-led interview uses a guide to ask a human participant questions and relevant follow-ups. The participant supplies the responses; the AI acts as interviewer. In EDSL, this is a `QuestionInterview`: a question type that contains a conversation and returns its transcript.

Use it when you want participants to describe experiences in their own words and clarify details as the conversation develops. An interview can be the whole survey or sit alongside [multiple-choice questions, ratings, and other question types](https://docs.expectedparrot.com/en/latest/questions.md). This lets you collect comparable measures and explore the experiences behind them in the same study.

## Combine an interview with structured questions

This survey first asks how often the participant exports reports, then explores their most recent experience in an interview, and finishes with an ease rating. The interview guide uses the first answer to put the conversation in context:

```python theme={null}
from edsl import QuestionInterview, QuestionLinearScale, QuestionMultipleChoice, Survey

frequency = QuestionMultipleChoice(
    question_name="export_frequency",
    question_text="How often do you export reports?",
    question_options=["Daily", "Weekly", "Less often"],
)

interview = QuestionInterview(
    question_name="export_experience",
    question_text="Describe your experience exporting a report.",
    interview_guide=(
        # Pipe the participant's earlier answer into the interviewer's guide.
        "The participant exports reports {{ export_frequency.answer }}. "
        "Ask about the participant's most recent attempt to export a report. "
        "Explore how that experience fits their usual reporting routine. "
        "Ask what they tried, where they encountered difficulty, and what helped. "
        "Use neutral follow-ups to clarify details; do not suggest problems."
    ),
    max_turns=8,
)

ease = QuestionLinearScale(
    question_name="export_ease",
    question_text="Overall, how easy was your most recent attempt to export a report?",
    question_options=[1, 2, 3, 4, 5],
    option_labels={1: "Very difficult", 5: "Very easy"},
)

# The interview is one question in the same survey as the structured questions.
survey = Survey([frequency, interview, ease])
humanize_schema = {
    "questions": {"export_experience": {"interview_mode": "text"}}
}
```

The interview occupies one position in the survey, but can contain multiple conversational turns. `question_text` introduces the topic and `interview_guide` directs the interviewer. `max_turns=8` limits interviewer turns; it does not define eight fixed questions. After the conversation, the participant proceeds to the rating question.

The schema selects text participation. See [Humanize schema](https://docs.expectedparrot.com/en/latest/humanize_schema.md) for voice and other interview options.

## Personalize the interview guide

Piping works inside `interview_guide` as well as `question_text`. In this example, `{{ export_frequency.answer }}` inserts the participant's answer to the earlier question. Someone who selects “Weekly” gives the interviewer the context “The participant exports reports Weekly.” The guide then directs the interviewer to explore how the experience fits that person's routine.

You can use the same approach with an earlier free-text answer, such as a task the participant wants to discuss. Place questions whose answers you pipe before the interview. [Survey logic and piping](https://docs.expectedparrot.com/en/latest/guides/survey_logic.md) explains how to combine this with branching, for example to ask an interview question only of participants with relevant experience.

Guides can also use information supplied by your study through [Scenarios](https://docs.expectedparrot.com/en/latest/scenarios.md). For example, `"Ask about exporting reports in {{ scenario.product }}."` makes the product a variable in the guide. Attach the scenarios with `survey.by(scenarios)` and choose how participants receive them when publishing; see [Human surveys with scenarios](https://docs.expectedparrot.com/en/latest/humanize.md#with-scenarios). This lets you reuse a guide across products, settings, or experimental conditions.

## Preview and publish

The following calls use Expected Parrot and require authentication. AI interviewing can incur usage costs. First obtain a preview and pilot the conversation with people:

```python theme={null}
preview_url = survey.preview(humanize_schema=humanize_schema)
```

Check that the guide uses the earlier answer, follow-ups stay on topic, and participants reach the final rating. When the instrument is ready, create the hosted survey:

```python theme={null}
info = survey.humanize(
    human_survey_name="Report export interviews",
    humanize_schema=humanize_schema,
)
respondent_url = info["respondent_url"]
human_survey_uuid = info["uuid"]
```

Preserve the UUID and distribute the respondent URL through the planned recruitment workflow. See [Human surveys](https://docs.expectedparrot.com/en/latest/humanize.md#retrieving-responses) for response retrieval and [Prolific](https://docs.expectedparrot.com/en/latest/prolific.md) for recruitment.

## Analyze the responses

After participants have responded, retrieve the structured answers and interview transcript together:

```python theme={null}
from edsl import Coop

results = Coop().get_human_survey_responses(human_survey_uuid)
results.select(
    "agent.response_uuid",
    "answer.export_frequency",
    "answer.export_experience",
    "answer.export_ease",
)
```

Each participant's transcript sits alongside their frequency and rating answers, so you can compare themes across frequent and occasional users or relate interview accounts to ease ratings. The interview answer contains messages with interviewer and respondent roles. Keep those roles when extracting passages so interviewer questions are not counted as participant statements. The [Qualitative coding example](https://docs.expectedparrot.com/en/latest/research/qualitative.md) shows how to analyze excerpts with themes and supporting quotations; use the response identifier to connect excerpts back to their interview.

For help developing the interview guide from a brief or source material, use the [Research Agent](https://docs.expectedparrot.com/en/latest/research_agent.md), then inspect and refine the EDSL study it produces.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.