Annotation Interface AgentIdentity


@Documented @Retention(RUNTIME) @Target(TYPE) public @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:

  1. Uses class simple name
  2. 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 Elements
    Modifier and Type
    Optional Element
    Description
    Contact 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.
    boolean
    Whether this agent is a singleton instance.
    Tags for categorization and discovery.
    Version of this agent definition.
  • Element Details

    • name

      String name
      The unique name identifying this agent.

      If not specified, defaults to class name without "Agent" suffix.

      Returns:
      agent name
      Default:
      ""
    • description

      String description
      A human-readable description of the agent.

      Used for documentation and exported to framework-specific fields.

      Returns:
      agent description
      Default:
      ""
    • version

      String version
      Version 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[] tags
      Tags for categorization and discovery.

      Can be used for filtering agents in registries.

      Returns:
      array of tags
      Default:
      {}
    • singleton

      boolean singleton
      Whether this agent is a singleton instance.

      Singleton agents have only one instance per runtime.

      Returns:
      true if singleton
      Default:
      false
    • language

      String language
      The primary language for agent communication.

      Affects system prompt generation and output formatting.

      Returns:
      language code (e.g., "en", "tr")
      Default:
      "en"
    • owner

      String owner
      Organization or team that owns this agent.

      Used for grouping and access control.

      Returns:
      owner identifier
      Default:
      ""
    • contact

      String contact
      Contact or support email for this agent.
      Returns:
      contact email
      Default:
      ""