Package com.tnsai.agents.annotations
Annotation Interface AgentIdentity
Defines the identity metadata for an Agent class.
This annotation provides a declarative way to define agent identity, enabling framework-agnostic agent definitions that can be exported to various agent frameworks.
Usage Example
@AgentIdentity(
name = "ResearchAssistant",
description = "AI-powered research helper",
version = "1.0.0",
tags = {"research", "academic", "analysis"}
)
public class ResearchAgent extends Agent {
// Agent implementation
}
Name Resolution
If name is not specified:
- Uses class simple name
- Removes "Agent" suffix if present
Example: ResearchAgent.class → "Research"
Framework Export
Agent identity is exported as:
- JASON: Agent name in .mas2j file
- JADE: Agent nickname and description
- SCOP: Agent ID and metadata
- LangChain: Agent name and description
- CrewAI: Agent role and backstory
- AutoGen: AssistantAgent name and system_message
- Author:
- TnsAI Team
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionContact or support email for this agent.A human-readable description of the agent.The primary language for agent communication.The unique name identifying this agent.Organization or team that owns this agent.booleanWhether this agent is a singleton instance.String[]Tags for categorization and discovery.Version of this agent definition.
-
Element Details
-
name
String nameThe unique name identifying this agent.If not specified, defaults to class name without "Agent" suffix.
- Returns:
- agent name
- Default:
""
-
description
String descriptionA human-readable description of the agent.Used for documentation and exported to framework-specific fields.
- Returns:
- agent description
- Default:
""
-
version
String versionVersion of this agent definition.Useful for tracking changes and compatibility.
- Returns:
- semantic version string (e.g., "1.0.0")
- Default:
"1.0.0"
-
tags
String[] tagsTags for categorization and discovery.Can be used for filtering agents in registries.
- Returns:
- array of tags
- Default:
{}
-
singleton
boolean singletonWhether this agent is a singleton instance.Singleton agents have only one instance per runtime.
- Returns:
- true if singleton
- Default:
false
-
language
String languageThe primary language for agent communication.Affects system prompt generation and output formatting.
- Returns:
- language code (e.g., "en", "tr")
- Default:
"en"
-
owner
String ownerOrganization or team that owns this agent.Used for grouping and access control.
- Returns:
- owner identifier
- Default:
""
-
contact
String contactContact or support email for this agent.- Returns:
- contact email
- Default:
""
-