Skip to main content

Persona Modules

In this section, we'll cover:

🎭 What is a Persona Module?

Persona modules define the character and behavior of AI agents. These modules enable more natural and specialized agent interactions by providing personality traits, communication styles, and behavioral patterns.

📝 Persona Configurations

The persona module is specified in the AgentConfig class:

#naptha_sdk/schemas.py
class AgentConfig(BaseModel):
config_name: Optional[str] = "agent_config"
llm_config: Optional[LLMConfig] = None
persona_module: Optional[Union[Dict, BaseModel]] = None
system_prompt: Optional[Union[Dict, BaseModel]] = None

Or in the deployment.json file in the configs folder of the agent module:

# AgentConfig in deployment.json file 
[
{
...
"config": {
"config_name": "agent_config",
"llm_config": {"config_name": "model_1"},
"persona_module" : {"name": "richard_twitter"},
"system_prompt": {
"role": "You are a helpful AI assistant.",
"persona": ""
}
}
}
]
info

The name of the persona_module should exactly match the name of the persona module in the personas registry on the Naptha Hub. The rest of the metadata will be loaded from the Hub. The data will be loaded into the persona field of the system_prompt dict.

🤖 Running an Agent that uses a Persona

Prerequisites

Install the Naptha SDK using the instructions here.

Examples

Below are examples of running the Simple Chat Agent with a twitter/X persona, generated from exported X data:

naptha run agent:simple_chat_agent -p "tool_name='chat' tool_input_data='who are you?'" --config '{"persona_module": {"name": "interstellarninja_twitter"}}'

and from a synthetically generated market persona based on census data:

naptha run agent:simple_chat_agent -p "tool_name='chat' tool_input_data='who are you?'" --config '{"persona_module": {"name": "marketagents_aileenmay"}}'

Need Help?

Next Steps