Psychologists often spend a significant portion of their time conducting interviews with subjects. When conducting surveys, human participants should be the gold standard when sourcing reliable information. However, when conducting these interviews, difficulties can occur as it can face a myriad of issues, such as long interview processes, thus limiting samples, issues with ethics, or a lack of participants. As agentic AI becomes more prevalent in society, we must understand how an AI will interact with individuals and other agentic AI. When interacting with others, the main considerations are both action and intention. These agents will then engage in agent-to-agent conversations to generate a large volume of synthetic data. The next step is to utilise Natural Language Processing (NLP) and compare the synthetic data with natural dyadic conversational data.
"Foresight is not about predicting the future, it's about minimizing surprise." — Karl Schroeder
Before running the project, ensure the following dependencies are installed:
Python
IDE (VSC) Recommended: https://code.visualstudio.com/
Ollama (Windows)
https://ollama.com/download/windows
React (Frontend Framework)
https://react.dev/learn/installation
Node.js (Frontend Framework)
https://nodejs.org/en
PrimeReact (UI Component Library)
https://primereact.org/installation/
To install all required Python packages, open a terminal in the project root and run:
pip install -r requirements.txt
npm install
npm install vite --save-dev
This installs all backend dependencies, including model clients, embedding libraries, PDF processing, and server utilities.
Ensure that LongPathsEnabled is enabled https://www.youtube.com/watch?v=U_Imp2TQyQI&t=162s (If you are using a University device you will need to contact IT services)
Navigate to the backend server directory and start the API:
cd server
python server.py
Once the server is running, your frontend can communicate with the backend, load agents, process RAG documents, and interact with your Ollama models.
When the GUI loads, the Persona Design tab is the first screen you’ll see. This workspace allows you to create, edit, export, and import persona design fields that will ultimately form a structured persona.json file. To begin defining a persona:
These fields allow you to build flexible, reusable persona definitions that can be exported for later use or imported into new sessions.
Add Field Options The Add Field feature provides three input types, each designed for different kinds of data:
Export JSON Option: The Export JSON feature provides an easy method to quickly:
Import JSON Option: The Import JSON feature provides an easy method to quickly:
This tab enables fully custom agent‑persona design. When the GUI loads, a persona sentence is automatically generated using the persona profiles created in the previous tabs.
If no persona sentence is available, the system will fall back to generating one using the gemma3:12b model. Ensure that this model is installed in your local Ollama environment to enable automatic persona synthesis.
Each agent is defined using a structured set of fields that mirror Ollama‑style model configuration concepts. These fields determine how the agent behaves, how it interprets instructions, and how it interacts within the wider system.
Specifies the underlying Ollama model used to generate responses.
This should match a model installed in your local Ollama environment (e.g., gemma3:12b, llama3.1:8b, mistral:7b).
The selected model determines the agent’s reasoning ability, style, and performance.
Full list of models: https://ollama.com/library, This project only utilises models that have the ability to return thinking
Defines the high‑level behavioural identity of the agent.
Options include:
"System""User""Assistant""Tool"This field acts similarly to the role concept in system‑prompting, guiding the agent’s overall persona and purpose.
A short instruction describing how the agent should behave.
This is equivalent to the primary system prompt in Ollama model definitions.
Use this field to define tone, constraints, or behavioural rules. (In OllamaClass.py this is defined as m.prompt, and model.updateContent())
Example:
“You are a concise, technically accurate assistant specialising in agentic AI workflows.”
Extended system‑level instructions that shape the agent’s reasoning and output style.
This is where you define deeper behavioural logic, multi‑step reasoning expectations, or domain‑specific constraints.
In Ollama terms, this corresponds to the system block inside a model’s configuration.
Optional text appended to the end of every prompt sent to the model.
These optional fields provide fine‑grained control over how the agent interacts with the model backend and how responses are delivered. They mirror advanced Ollama runtime parameters and allow you to tune performance, streaming behaviour, and context handling.
Enables or disables token‑streaming for the agent’s responses.
When enabled, the model returns output incrementally as it is generated, improving responsiveness for long outputs or interactive workflows.
When true, returns the raw response from the model without any prompt templating Useful for debugging, inspecting token behaviour, or building custom formatting layers on top of the model output.
Typical values:
true — return raw model output exactly as generatedfalse — apply normal formatting and cleanupSpecifies how long the model instance should remain active after a request.
A longer keep‑alive reduces cold‑start latency when making repeated calls to the same model.
Examples:
"5m" — keep the model loaded for 5 minutes"0s" — unload immediately after each requestAllows the agent to send an image as part of the request payload.
This is used when working with multimodal models that support vision input.
If no image is provided, this field remains empty.
Defines the maximum context window (in tokens) available to the agent.
This determines how much prior conversation or prompt history the model can retain.
Examples:
2048 — standard context8192 or higher — extended‑context modelsWarning:
These fields control how the underlying model generates text. They correspond to common Ollama‑style sampling parameters and allow you to fine‑tune creativity, determinism, and output length.
Controls randomness in the model’s output.
Lower values make responses more deterministic; higher values increase creativity and variation.
Examples:
0.0–0.3 — factual, stable, low‑variance0.7–1.0 — creative, exploratory>1.0 — highly random, less predictableLimits sampling to the top‑K most likely next tokens.
A smaller K makes output more focused; a larger K increases diversity.
Examples:
1 — greedy, deterministic100 — more open‑ended generationInstead of selecting a fixed number of tokens (Top‑K), Top‑P selects from the smallest probability mass whose cumulative probability exceeds P.
This allows dynamic control over diversity.
Examples:
0.9 — balanced, natural language flow0.5 — more restrictive, precise0.95+ — more creativeSets a deterministic seed for reproducible outputs.
If the same prompt, model, and seed are used, the model will generate identical text.
Examples:
12345 — fixed reproducible seednull — fully random generationDefines the maximum context window (in tokens) available to the model.
This determines how much conversation history or prompt content the model can retain.
Examples:
2048 — standard context4096–8192 — extended contextSets the maximum number of tokens the model is allowed to generate in its response.
Examples:
128 — short, concise answers512 — medium‑length responses2048+ — long‑form generationDefines one or more stop sequences that immediately end generation when encountered.
Useful for enforcing structured output, JSON boundaries, or multi‑agent turn‑taking.
Export JSON Option: The Export JSON feature provides an easy method to quickly:
Import JSON Option: The Import JSON feature provides an easy method to quickly:
(The Agent Template is fully portable and can be injected into any OllamaClass.py implementation.)
The system supports uploading PDF documents for use in Retrieval‑Augmented Generation (RAG) workflows. These PDFs are ingested, chunked, and embedded so that agents can reference them during reasoning and response generation.
If the Agent Profile Template contains missing fields, invalid values, or malformed configuration data, the system will return a clear error message describing the error.
Generattion Details:
After submitting a JSON configuration, all existing files are automatically replaced with the new profiles and parameters.
Run generate.py to execute the full generation pipeline.
The system is built using the CRRR architecture (Constrained Prompting → Retrieval → Reflection → Reflexion).
Every time an agent produces a component of its final response—whether it’s a retrieved context block, a reflexion pass, or a final utterance—the system stores that output as a generation ticket. These tickets provide a complete audit trail of how the agent constructed its answer.
Path = Server -> RAGOutput -> Gen
Running Analysis.py Analysis.py supports two input modes:
Synthetic corpora generated by the system
Natural corpora loaded as a ConvoKit dataset
Follow the instructions below depending on your workflow.
If your corpus was generated by the system:
Run Analysis.py normally.
When prompted, paste the path to the folder containing your synthetic corpus JSON files.
No code changes are required.
If you want to analyse a ConvoKit dataset instead of synthetic data:
Open Analysis.py
Comment out lines 171–178, which handle synthetic‑corpus directory loading.
Add your ConvoKit corpus download (e.g., Corpus(filename=...) or download("corpus-name")) on line 178.
Unindent lines 179–180 so they execute directly when using a ConvoKit corpus.
This switches the pipeline from directory‑based synthetic loading to ConvoKit’s native corpus format.
Run compareGraph.py
When prompted for the baseline:
When prompted for the comparison:
Run ANOVA.py
When prompted for the baseline:
When prompted for the comparison:
When generating synthetic data for psychological research, several ethical considerations must be addressed. The persona‑design process within the proposed system enables researchers to approximate the demographics and characteristics of real interviewees, allowing the tool to function as a proxy for natural interviews. To ensure this practice remains ethically sound, three guidelines are recommended:
Declaration of Use.
Any use of synthetic conversations must be explicitly disclosed. Clear declaration ensures that other researchers can accurately interpret the methodological choices and understand that synthetic data contributed to the reported findings.
Data Storage and Transparency.
Where appropriate, synthetic data should be stored separately from natural data and made publicly accessible. This separation allows independent verification, supports reproducibility, and prevents unintentional conflation of synthetic and natural corpora.
Threshold of Natural Data.
Synthetic data should only be introduced after a meaningful quantity of natural interviews has been collected. The system is intended to supplement not replace human generated data. Maintaining a threshold helps preserve ecological validity and prevents over‑reliance on synthetic corpora.
Together, these guidelines promote transparency, reproducibility, and responsible use of synthetic conversational data in psychological research.
CC BY‑NC‑SA License
This work is released under the Creative Commons Attribution–NonCommercial–ShareAlike license. This license permits redistribution, adaptation, and non‑commercial use, provided that appropriate attribution is given and any derivative works are distributed under the same license.
Restrictions:
Users may not employ automated systems—including scrapers or AI models—to extract, analyse, or otherwise process this repository or its contents.
Acceptance:
By downloading, installing, or using this software, you acknowledge and accept these terms.
Psychologists often spend a significant portion of their time conducting interviews with subjects. When conducting surveys, human participants should be the gold standard when sourcing reliable information. However, when conducting these interviews, difficulties can occur as it can face a myriad of issues, such as long interview processes, thus limiting samples, issues with ethics, or a lack of participants. As agentic AI becomes more prevalent in society, we must understand how an AI will interact with individuals and other agentic AI. When interacting with others, the main considerations are both action and intention. These agents will then engage in agent-to-agent conversations to generate a large volume of synthetic data. The next step is to utilise Natural Language Processing (NLP) and compare the synthetic data with natural dyadic conversational data.
"Foresight is not about predicting the future, it's about minimizing surprise." — Karl Schroeder
Before running the project, ensure the following dependencies are installed:
Python
IDE (VSC) Recommended: https://code.visualstudio.com/
Ollama (Windows)
https://ollama.com/download/windows
React (Frontend Framework)
https://react.dev/learn/installation
Node.js (Frontend Framework)
https://nodejs.org/en
PrimeReact (UI Component Library)
https://primereact.org/installation/
To install all required Python packages, open a terminal in the project root and run:
pip install -r requirements.txt
npm install
npm install vite --save-dev
This installs all backend dependencies, including model clients, embedding libraries, PDF processing, and server utilities.
Ensure that LongPathsEnabled is enabled https://www.youtube.com/watch?v=U_Imp2TQyQI&t=162s (If you are using a University device you will need to contact IT services)
Navigate to the backend server directory and start the API:
cd server
python server.py
Once the server is running, your frontend can communicate with the backend, load agents, process RAG documents, and interact with your Ollama models.
When the GUI loads, the Persona Design tab is the first screen you’ll see. This workspace allows you to create, edit, export, and import persona design fields that will ultimately form a structured persona.json file. To begin defining a persona:
These fields allow you to build flexible, reusable persona definitions that can be exported for later use or imported into new sessions.
Add Field Options The Add Field feature provides three input types, each designed for different kinds of data:
Export JSON Option: The Export JSON feature provides an easy method to quickly:
Import JSON Option: The Import JSON feature provides an easy method to quickly:
This tab enables fully custom agent‑persona design. When the GUI loads, a persona sentence is automatically generated using the persona profiles created in the previous tabs.
If no persona sentence is available, the system will fall back to generating one using the gemma3:12b model. Ensure that this model is installed in your local Ollama environment to enable automatic persona synthesis.
Each agent is defined using a structured set of fields that mirror Ollama‑style model configuration concepts. These fields determine how the agent behaves, how it interprets instructions, and how it interacts within the wider system.
Specifies the underlying Ollama model used to generate responses.
This should match a model installed in your local Ollama environment (e.g., gemma3:12b, llama3.1:8b, mistral:7b).
The selected model determines the agent’s reasoning ability, style, and performance.
Full list of models: https://ollama.com/library, This project only utilises models that have the ability to return thinking
Defines the high‑level behavioural identity of the agent.
Options include:
"System""User""Assistant""Tool"This field acts similarly to the role concept in system‑prompting, guiding the agent’s overall persona and purpose.
A short instruction describing how the agent should behave.
This is equivalent to the primary system prompt in Ollama model definitions.
Use this field to define tone, constraints, or behavioural rules. (In OllamaClass.py this is defined as m.prompt, and model.updateContent())
Example:
“You are a concise, technically accurate assistant specialising in agentic AI workflows.”
Extended system‑level instructions that shape the agent’s reasoning and output style.
This is where you define deeper behavioural logic, multi‑step reasoning expectations, or domain‑specific constraints.
In Ollama terms, this corresponds to the system block inside a model’s configuration.
Optional text appended to the end of every prompt sent to the model.
These optional fields provide fine‑grained control over how the agent interacts with the model backend and how responses are delivered. They mirror advanced Ollama runtime parameters and allow you to tune performance, streaming behaviour, and context handling.
Enables or disables token‑streaming for the agent’s responses.
When enabled, the model returns output incrementally as it is generated, improving responsiveness for long outputs or interactive workflows.
When true, returns the raw response from the model without any prompt templating Useful for debugging, inspecting token behaviour, or building custom formatting layers on top of the model output.
Typical values:
true — return raw model output exactly as generatedfalse — apply normal formatting and cleanupSpecifies how long the model instance should remain active after a request.
A longer keep‑alive reduces cold‑start latency when making repeated calls to the same model.
Examples:
"5m" — keep the model loaded for 5 minutes"0s" — unload immediately after each requestAllows the agent to send an image as part of the request payload.
This is used when working with multimodal models that support vision input.
If no image is provided, this field remains empty.
Defines the maximum context window (in tokens) available to the agent.
This determines how much prior conversation or prompt history the model can retain.
Examples:
2048 — standard context8192 or higher — extended‑context modelsWarning:
These fields control how the underlying model generates text. They correspond to common Ollama‑style sampling parameters and allow you to fine‑tune creativity, determinism, and output length.
Controls randomness in the model’s output.
Lower values make responses more deterministic; higher values increase creativity and variation.
Examples:
0.0–0.3 — factual, stable, low‑variance0.7–1.0 — creative, exploratory>1.0 — highly random, less predictableLimits sampling to the top‑K most likely next tokens.
A smaller K makes output more focused; a larger K increases diversity.
Examples:
1 — greedy, deterministic100 — more open‑ended generationInstead of selecting a fixed number of tokens (Top‑K), Top‑P selects from the smallest probability mass whose cumulative probability exceeds P.
This allows dynamic control over diversity.
Examples:
0.9 — balanced, natural language flow0.5 — more restrictive, precise0.95+ — more creativeSets a deterministic seed for reproducible outputs.
If the same prompt, model, and seed are used, the model will generate identical text.
Examples:
12345 — fixed reproducible seednull — fully random generationDefines the maximum context window (in tokens) available to the model.
This determines how much conversation history or prompt content the model can retain.
Examples:
2048 — standard context4096–8192 — extended contextSets the maximum number of tokens the model is allowed to generate in its response.
Examples:
128 — short, concise answers512 — medium‑length responses2048+ — long‑form generationDefines one or more stop sequences that immediately end generation when encountered.
Useful for enforcing structured output, JSON boundaries, or multi‑agent turn‑taking.
Export JSON Option: The Export JSON feature provides an easy method to quickly:
Import JSON Option: The Import JSON feature provides an easy method to quickly:
(The Agent Template is fully portable and can be injected into any OllamaClass.py implementation.)
The system supports uploading PDF documents for use in Retrieval‑Augmented Generation (RAG) workflows. These PDFs are ingested, chunked, and embedded so that agents can reference them during reasoning and response generation.
If the Agent Profile Template contains missing fields, invalid values, or malformed configuration data, the system will return a clear error message describing the error.
Generattion Details:
After submitting a JSON configuration, all existing files are automatically replaced with the new profiles and parameters.
Run generate.py to execute the full generation pipeline.
The system is built using the CRRR architecture (Constrained Prompting → Retrieval → Reflection → Reflexion).
Every time an agent produces a component of its final response—whether it’s a retrieved context block, a reflexion pass, or a final utterance—the system stores that output as a generation ticket. These tickets provide a complete audit trail of how the agent constructed its answer.
Path = Server -> RAGOutput -> Gen
Running Analysis.py Analysis.py supports two input modes:
Synthetic corpora generated by the system
Natural corpora loaded as a ConvoKit dataset
Follow the instructions below depending on your workflow.
If your corpus was generated by the system:
Run Analysis.py normally.
When prompted, paste the path to the folder containing your synthetic corpus JSON files.
No code changes are required.
If you want to analyse a ConvoKit dataset instead of synthetic data:
Open Analysis.py
Comment out lines 171–178, which handle synthetic‑corpus directory loading.
Add your ConvoKit corpus download (e.g., Corpus(filename=...) or download("corpus-name")) on line 178.
Unindent lines 179–180 so they execute directly when using a ConvoKit corpus.
This switches the pipeline from directory‑based synthetic loading to ConvoKit’s native corpus format.
Run compareGraph.py
When prompted for the baseline:
When prompted for the comparison:
Run ANOVA.py
When prompted for the baseline:
When prompted for the comparison:
When generating synthetic data for psychological research, several ethical considerations must be addressed. The persona‑design process within the proposed system enables researchers to approximate the demographics and characteristics of real interviewees, allowing the tool to function as a proxy for natural interviews. To ensure this practice remains ethically sound, three guidelines are recommended:
Declaration of Use.
Any use of synthetic conversations must be explicitly disclosed. Clear declaration ensures that other researchers can accurately interpret the methodological choices and understand that synthetic data contributed to the reported findings.
Data Storage and Transparency.
Where appropriate, synthetic data should be stored separately from natural data and made publicly accessible. This separation allows independent verification, supports reproducibility, and prevents unintentional conflation of synthetic and natural corpora.
Threshold of Natural Data.
Synthetic data should only be introduced after a meaningful quantity of natural interviews has been collected. The system is intended to supplement not replace human generated data. Maintaining a threshold helps preserve ecological validity and prevents over‑reliance on synthetic corpora.
Together, these guidelines promote transparency, reproducibility, and responsible use of synthetic conversational data in psychological research.
CC BY‑NC‑SA License
This work is released under the Creative Commons Attribution–NonCommercial–ShareAlike license. This license permits redistribution, adaptation, and non‑commercial use, provided that appropriate attribution is given and any derivative works are distributed under the same license.
Restrictions:
Users may not employ automated systems—including scrapers or AI models—to extract, analyse, or otherwise process this repository or its contents.
Acceptance:
By downloading, installing, or using this software, you acknowledge and accept these terms.