Core Concepts

Personas, Agents, and Multi-Backend Support

The core of SDialog is built upon a few key concepts that enable flexible and powerful conversational AI simulations. These include programmable Personas, modular Agents that encapsulate them, and broad support for various LLM backends.

Fundamental Building Blocks

Personas

Define the characteristics, background, and communication style of a conversational participant. Use built-in personas or create your own.

Agents

The main actors in a dialogue. Agents are built around a persona and can be equipped with tools, thoughts, and orchestrators.

Interoperability

Connect to a wide range of LLM providers including OpenAI, Hugging Face, Ollama, AWS Bedrock, and Google GenAI.

Multi-Agent Simulation

Simulate conversations between two or more agents to generate realistic dialogue data for testing and training.

Usage Example


import sdialog
from sdialog.agents import Agent
from sdialog.personas import SupportAgent, Customer

# Configure the LLM backend (supports openai, ollama, huggingface, etc.)
sdialog.config.llm("ollama:qwen3:14b")
# sdialog.config.llm("openai:gpt-4.1", api_key="YOUR_KEY")

# 1. Define Personas for the agents
support_persona = SupportAgent(
    name="Ava",
    politeness="high",
    communication_style="friendly"
)
customer_persona = Customer(
    name="Riley",
    issue="double charge",
    desired_outcome="refund"
)

# 2. Create Agents from the personas
support_agent = Agent(persona=support_persona, name="Support")
simulated_customer = Agent(
    persona=customer_persona,
    first_utterance="Hi, I think I was double charged.",
    name="Customer"
)

# 3. Simulate a conversation
dialog = simulated_customer.dialog_with(support_agent, max_turns=5)

dialog.print()
dialog.to_file("support_dialog.json")