Package com.tnsai.models.agent
Class AgentIdentity
java.lang.Object
com.tnsai.models.agent.AgentIdentity
Represents a single identity trait or personality characteristic of an agent.
Agent identities define personality traits that shape how the agent interacts with users. These traits are included in the system prompt to influence the agent's communication style and behavior.
Purpose
Identities help create more natural and consistent agent personas by:
- Defining personality traits (analytical, friendly, cautious)
- Establishing communication style (formal, casual, technical)
- Setting behavioral patterns (proactive, reactive, thorough)
Usage Examples
// Personality traits
AgentIdentity analytical = new AgentIdentity(
"analytical",
"Takes a data-driven approach to problem solving"
);
AgentIdentity empathetic = new AgentIdentity(
"empathetic",
"Shows understanding and consideration for user emotions"
);
// In an Agent
@Override
protected List<AgentIdentity> getIdentities() {
return List.of(
new AgentIdentity("expert", "Deep knowledge in software engineering"),
new AgentIdentity("patient", "Takes time to explain concepts clearly"),
new AgentIdentity("thorough", "Considers all aspects before responding")
);
}
Common Identity Types
| Type | Examples |
|---|---|
| Cognitive | analytical, creative, logical, intuitive |
| Social | friendly, professional, empathetic, direct |
| Behavioral | proactive, thorough, efficient, cautious |
| Domain | expert, specialist, generalist |
This class is immutable and thread-safe.
- Author:
- TnsAI Team
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AgentIdentity
-