Skip to main content
Using a dataset of job posts as an example, we demonstrate how to:
1
Import data into EDSL
2
Create questions about the data
3
Design an AI agent to answer the questions
4
Select a language model to generate responses
5
Analyze results as a formatted dataset

Technical setup

Before running the code below please ensure that you have completed setup: Our Starter Tutorial also provides examples of EDSL basic components.

Selecting data for review

First we identify some data for review. Data can be created using the EDSL tools or imported from other sources. For purposes of this demo we import a set of job posts:

Constructing questions about the data

Next we create some questions about the data. EDSL provides a variety of question types that we can choose from based on the form of the response that we want to get back from the model (multiple choice, free text, checkbox, linear scale, etc.). Learn more about question types. Note that we use a {{ placeholder }} in each question text in order to parameterize the questions with the individual job posts in the next step:

Building a survey

We combine the questions into a survey in order to administer them together:
If we want the agent/model to have information about prior questions in the survey we can add targeted or full memories (learn more about adding survey rules/logic):

Adding data to the questions

We add the contents of each ticket into each question as an independent “scenario” for review. This allows us to create versions of the questions for each job post and deliver them to the model all at once. EDSL provides many methods for generating scenarios from different data sources (PDFs, CSVs, docs, images, tables, dicts, etc.). Here we import the list from above:

Designing AI agents

A key feature of EDSL is the ability to create personas for AI agents that the language models are prompted to use in generating responses to the questions. This is done by passing a dictionary of traits to Agent objects:

Selecting language models

EDSL allows us to select the language models to use in generating results. To see all available services:
A current list of available models can be viewed here. Here we select GPT 4o (if no model is specified, this model is also used by default):

Running the survey

We run the survey by adding the scenarios, agent and model with the by() method and then calling the run() method:
This generates a dataset of Results that we can analyze with built-in methods for data tables, dataframes, SQL, etc. We can see a list of all the components that can be analyzed:
For example, we can filter, sort, select, limit, shuffle, sample and print some components of results in a table:

Posting content to Expected Parrot

We can post any objects to Expected Parrot, including this notebook. Objects can be updated or modified at your account, and shared with others or stored privately (default visibility is unlisted):