Documentation

Getting Started

From zero to a running OASIS instance in about five minutes. All you need is Docker and at least one API key.

# Quick Start

You need Docker and an OpenAI API key. That's the minimum for a complete voice or text interview end-to-end. Everything else is optional.

1. Clone and set two env vars

$ git clone https://github.com/oasis-surveys/oasis-platform.git
$ cd oasis-platform
$ cp .env.example .env
$ # edit .env → set OPENAI_API_KEY and SECRET_KEY
$ docker compose up -d

2. Open the dashboard

Go to http://localhost. Create a study, pick a research template, and you have a working interview agent. Copy the share link and try it out.

With just an OpenAI key you get text chat (GPT-4o-mini), modular voice (Whisper STT + GPT-4o-mini-tts), and voice-to-voice (OpenAI Realtime). Add other provider keys later if you need them — see Configuration below.

# Prerequisites

  • Docker & Docker Compose. OASIS runs as five containers. Install Docker Desktop (includes Compose v2) on macOS/Windows, or Docker Engine + Compose plugin on Linux.
  • At least one LLM API key. An OpenAI key is the easiest starting point. You can also use Google AI Studio, Anthropic, Mistral, Scaleway, or self-hosted endpoints.
  • (For voice agents) STT & TTS. Modular voice pipelines need speech-to-text and text-to-speech. Options: OpenAI (Whisper + TTS), Deepgram + ElevenLabs, or self-hosted servers (Speaches, Kokoro, Piper, etc.). Not needed for voice-to-voice models (OpenAI Realtime, Gemini Live) or text chat agents.

Responsible Use of AI in Research

Please read this before getting started.

OASIS gives researchers powerful capabilities: AI agents that can conduct adaptive conversations with human participants at scale. With that power comes a serious obligation to use it responsibly.

OASIS is built for legitimate research. It is designed to advance science, understand communities, and improve how we collect qualitative and quantitative data.

OASIS must not be used for:

  • Deception or manipulation of participants
  • Surveillance, profiling, or data harvesting without informed consent
  • Any application that harms, exploits, or undermines the well-being of participants
  • Circumventing ethics review processes or informed consent requirements

AI-enabled survey methods are a new and rapidly evolving field. Best practices are still being established, and the potential for misuse is real. As researchers and practitioners, we have a collective responsibility to set high ethical standards from the start, before norms calcify.

If you're using OASIS in a study, make sure your use is covered by appropriate ethics review (e.g., IRB/ethics board approval), that participants are informed they are interacting with an AI, and that your data handling meets the standards of your institution and jurisdiction.

# Installation

Clone the repository and copy the environment template:

$ git clone https://github.com/oasis-surveys/oasis-platform.git
$ cd oasis-platform
$ cp .env.example .env

Then start everything:

$ docker compose up -d

This pulls and builds five containers: Caddy (reverse proxy + auto-SSL), React frontend, FastAPI backend, PostgreSQL (with pgvector), and Redis. The dashboard will be available at http://localhost.

# Configuration

All configuration lives in a single .env file. Here's the essential structure:

# ── Application ──
APP_NAME=OASIS
SECRET_KEY=change-me-to-a-random-secret-key

# ── Database ──
POSTGRES_USER=oasis
POSTGRES_PASSWORD=change-me
POSTGRES_DB=oasis

# ── AI Providers (add what you need) ──
OPENAI_API_KEY=sk-...
DEEPGRAM_API_KEY=...
ELEVENLABS_API_KEY=...

# ── Optional Providers ──
GOOGLE_API_KEY=...            # Gemini Live
SCALEWAY_SECRET_KEY=...      # Scaleway LLMs
ANTHROPIC_API_KEY=...        # Claude

# ── EU Data Residency (Optional) ──
OPENAI_USE_EU=false           # Route OpenAI calls via eu.api.openai.com

# ── Custom OpenAI-Compatible LLM (Optional) ──
OPENAI_COMPATIBLE_LLM_URL=...      # e.g. LiteLLM proxy, vLLM, Ollama
OPENAI_COMPATIBLE_LLM_API_KEY=...

# ── Self-Hosted STT/TTS (Optional) ──
SELF_HOSTED_STT_URL=...      # OpenAI-compatible STT server
SELF_HOSTED_TTS_URL=...      # OpenAI-compatible TTS server

# ── Embeddings (Optional) ──
EMBEDDING_API_URL=...        # Self-hosted embedding server

# ── Telephony (Optional) ──
TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
TWILIO_PHONE_NUMBER=+1...

# ── Domain (use localhost for dev) ──
DOMAIN=localhost
💡 Tip: You can also set API keys at runtime via the dashboard's Settings page, no container restart required. Keys set via the dashboard are stored in Redis and take precedence over .env values.

# Your First Agent

Quick start: Instead of configuring from scratch, you can pick a research template to get a working agent in one click. Templates ship with a system prompt, model defaults, and sensible settings — just tweak to taste.
  1. 1 Open the dashboard at http://localhost and click New Study.
  2. 2 Give your study a name and description. Click Create.
  3. 3 Inside the study, click New Agent (or choose a template). Select Voice or Text modality.
  4. 4 Write your system prompt. This is the instruction that shapes the agent's behaviour. Tell it what to ask, how to probe, and when to wrap up.
  5. 5 Select your LLM model and pipeline type (voice-to-voice or modular STT→LLM→TTS).
  6. 6 Set the agent status to Active and save. Copy the interview link or embed code.

# Agent Templates

Templates are curated starter agents that get you from "I just installed this" to "I have a working interview" in under a minute. Each one ships with a system prompt, welcome message, model/pipeline defaults, and (where appropriate) a structured interview guide.

Pick a template from the dashboard when creating an agent. The agent lands as Active immediately — you can edit or pause it any time.

Template Modality Use Case
Semi-Structured Qualitative Voice Open-ended qualitative research — lived-experience, attitudes, exploratory work
Cognitive Interview / Pretest Voice Pretesting survey items with think-aloud probes (comprehension, recall, judgment, response)
Structured Topic Guide Voice Fixed protocol with ordered questions, probes, and auto-advance — comparative qualitative work
Open-Ended Follow-Up Text Post-survey follow-up via text chat — embed at the end of a Qualtrics/REDCap/LimeSurvey questionnaire
Conversational Phone Survey Voice (V2V) Low-latency telephone surveys via Twilio — CATI-style, uses OpenAI Realtime

All templates default to OpenAI models so anyone with just an OPENAI_API_KEY in .env can start immediately. Swap the provider in the agent form afterwards.

# Structured Interviews

For semi-structured protocols, set the Interview Mode to Structured when creating an agent. You can then define an interview guide with ordered questions, follow-up probes, and transition messages.

You can build the guide directly in the dashboard, or upload a CSV or JSON file. Download the template from the dashboard to see the expected format:

// interview-guide.json
{
  "questions": [
    {
      "text": "Can you tell me about your experience with...?",
      "probes": [
        "What specific aspects stood out?",
        "How did that compare to your expectations?"
      ],
      "max_follow_ups": 3,
      "transition": "Thank you, now I'd like to ask about..."
    }
  ],
  "closing_message": "Thank you for your time."
}

The agent will follow the guide as a backbone but can adapt naturally. It probes when appropriate, moves on after the configured number of follow-ups, and uses transition messages between questions.

# Text Chat Agents

When you select Text as the modality, the agent conducts interviews via a chat interface instead of voice. No STT or TTS keys are needed.

  • Choose from several avatar styles: Robot, Neutral, Male, Female, or None.
  • The transcript output format is identical to voice agents, same export, same analytics.
  • Works with any chat-compatible LLM (GPT-4.1, Claude, Gemini, etc.).
# Participant Tracking

Each agent has a Participant ID mode that controls how sessions are linked to individual participants. Pick the mode that fits your study design:

Random (default)

The system generates a random identifier for each session. No participant management needed. Good for anonymous studies or quick pilots.

Predefined

Upload a list of participant identifiers in the dashboard (individually or in bulk). Distribute personalised links like /interview/{widget_key}?pid=ABC123. Each identifier can only be used once. You can release a used identifier if you need to let someone retake.

Input

Participants type their own identifier (e.g. a panel ID or email) before the interview starts. Useful for linking to an external survey platform where participants already have an ID.

# Model Selection

OASIS uses LiteLLM under the hood, which means you can use virtually any LLM provider with a unified API format.

Pipeline Supported Models
Voice-to-Voice OpenAI Realtime (gpt-4o-realtime, gpt-4o-mini-realtime), Gemini Live (gemini-2.5-flash-native-audio)
Modular (STT→LLM→TTS) LLM: GPT-4.1, GPT-5, Claude 3.5/4, Gemini 2.5, Mistral, Scaleway, custom endpoints, or any LiteLLM-compatible model
STT: OpenAI Whisper, Deepgram, or self-hosted (OpenAI-compatible)
TTS: OpenAI TTS, ElevenLabs, or self-hosted (OpenAI-compatible)
Text Chat Same as Modular LLM options — any chat-completion compatible model
Custom models: Select "Custom" in the model dropdown and enter any valid LiteLLM model identifier (e.g., azure/my-gpt4-deployment or vertex_ai/gemini-pro). For fully self-hosted LLMs, set OPENAI_COMPATIBLE_LLM_URL in .env and use model names starting with custom/.
# Self-Hosted STT/TTS

If you want to keep audio processing on your own infrastructure — or just avoid third-party API costs — you can point OASIS at any server that speaks the OpenAI STT/TTS protocol.

Compatible servers include Speaches (faster-whisper), Kokoro, Piper, LocalAI, and similar projects. Set the following in .env:

  • SELF_HOSTED_STT_URL — base URL of your STT server (e.g. http://my-server:8000/v1)
  • SELF_HOSTED_TTS_URL — base URL of your TTS server
  • SELF_HOSTED_STT_MODEL / SELF_HOSTED_TTS_MODEL — model name the server expects (defaults to whisper-1 and tts-1)

Then select "Self-Hosted" as the STT or TTS provider in the agent form. API keys are optional — most local servers don't require them.

# EU Data Residency

For GDPR-sensitive studies, OASIS supports routing all OpenAI traffic through the EU regional endpoint (eu.api.openai.com). This covers chat completions, Realtime, STT, TTS, and embeddings.

Set OPENAI_USE_EU=true in .env (or toggle it in the dashboard Settings under feature flags). This requires that the OpenAI project tied to your API key has data-residency enabled and a Zero Data Retention or Modified Abuse Monitoring amendment in place.

For non-OpenAI providers, you can use Scaleway (EU-based LLM-as-a-Service), self-hosted models, or any provider that meets your institutional data-handling requirements.

# Deployment Options

🖥️ Local Development

docker compose up -d with DOMAIN=localhost. Access at http://localhost. Caddy serves without SSL.

🌍 Production (Any VPS)

Set DOMAIN=your-domain.com in .env. Point your DNS A-record to the server. Caddy auto-provisions Let's Encrypt SSL certificates.

☁️ GCP / Azure

Deploy on a VM or container instance. Use Vertex AI or Azure OpenAI endpoints by setting the corresponding environment variables.

🇪🇺 Scaleway (EU)

For European data residency. Use Scaleway's LLM-as-a-Service with SCALEWAY_SECRET_KEY for GDPR-compliant deployments.

# Authentication

Authentication is off by default. To enable basic login protection for the dashboard:

# In .env:
AUTH_ENABLED=true
AUTH_USERNAME=admin
AUTH_PASSWORD=your-secure-password

Then recreate the backend container: docker compose up -d --force-recreate backend. Interview links remain publicly accessible. Authentication only protects the admin dashboard.

# Telephony (Twilio)
⚠️ Beta: Telephony integration is currently in beta. Only incoming calls are supported. Participants call your Twilio number. Outbound call scheduling and call routing are not yet available.

OASIS supports telephone-based interviews via Twilio Media Streams. Add your Twilio credentials to .env, assign a phone number to an agent in the dashboard, and participants can call in for voice interviews.

TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TWILIO_PHONE_NUMBER=+1234567890

The backend exposes a TwiML webhook that Twilio calls when someone dials your number. Audio is streamed over WebSockets using Pipecat's TwilioFrameSerializer.

# Knowledge Base (RAG)

Upload documents to a study's knowledge base to give your agent context about the research topic. Documents are chunked, embedded, and stored in PostgreSQL via pgvector for similarity search.

By default, embeddings use OpenAI's text-embedding-3-small (1536 dimensions). To use a self-hosted embedding server instead, set EMBEDDING_API_URL in .env — any OpenAI-compatible endpoint works (e.g. LocalAI, TEI, vLLM).

During an interview, the agent queries the knowledge base to retrieve relevant context before generating a response. Useful for topic-specific interviews where the agent needs factual grounding.

Note: The database schema expects 1536-dimensional vectors. If your embedding model outputs a different dimension, you'll need a database migration.
# API Reference

The FastAPI backend serves auto-generated OpenAPI documentation. Once your instance is running:

  • Swagger UI: http://localhost/api/docs
  • ReDoc: http://localhost/api/redoc

Key endpoints include:

Method Endpoint Description
GET /api/studies List all studies
POST /api/studies/{id}/agents Create an agent
GET /api/templates List agent templates
GET /api/.../sessions/{id} Session detail with transcript
GET /api/.../sessions/export/csv Export sessions as CSV
WS /ws/interview/{widget_key} Voice interview WebSocket
WS /ws/chat/{widget_key} Text chat WebSocket
WS /ws/monitor/{session_id} Live transcript stream (dashboard)

Need Help?

Found a bug, have a question, or want to request a feature? Open an issue on GitHub or reach out directly.