Persona Set

An AI persona can be used to mimic a particular role by defining a system prompt and optionally equipping it with tools. A persona set is set of personas, which can be conveniently curated and/or imported through RELAI platform.

Create Persona Set

  1. To create a persona set, first go to RELAI platform and find Persona Sets under AgentHub.

    RELAI platform->AgentHub->Persona Sets

  2. Click "Create Persona Set".

    Create Persona Set

  3. Name the new persona set; Upload a CSV file with a system_prompts column to populate the list, or add prompts manually.

    Upload a CSV file with a <code>system_prompts</code> column to populate the list, or add prompts manually.

  4. And done! Your persona set is created. You can chat with personas directly here and adjust them further whenever needed.

    Successful persona set creation

Use Persona Set in Simulation

  1. Decorate inputs/tools that will be simulated.

    from relai import simulated
    
    @simulated
    async def get_user_input():
        msg = input("User: ")
        return msg
    
  2. When setting up the simulation environment, bind the persona set to the corresponding fully-qualified function names.

    from relai.simulator import AsyncSimulator, random_env_generator
    
    env_generator = random_env_generator(
        {"__main__.get_user_input": PersonaSet(persona_set_id="your_persona_set_id_here")}
    )
    
    async def main():
        async with AsyncRELAI() as client:
            simulator = AsyncSimulator(
                client=client,
                agent_fn=<your agent function here>, 
                env_generator=env_generator,
                log_runs=True,
            )
    
            agent_logs = await simulator.run(num_runs=4)
            print(agent_logs)
    
    asyncio.run(main())