Skip to main content
The Agent exposes numerous attributes that control its behavior and capabilities. Understanding these attributes is crucial for effective agent configuration.

Core Identity Attributes

AttributeTypeDefaultDescription
namestr | NoneNoneHuman-readable name for the agent
agent_id_str | NoneNoneUnique identifier for the agent instance
model_providerBaseModelProvider | NoneOpenAI(“gpt-4o”)The underlying LLM provider
Example:
agent = Agent(
    name="CreditRiskAnalyst",
    agent_id_="risk_analyst_001"
)
print(f"Agent: {agent.name}, ID: {agent.agent_id}")

Model and Performance Attributes

AttributeTypeDefaultDescription
modelUnion[str, BaseModelProvider]“openai/gpt-4o”Model specification (string or provider instance)
retryint1Number of retry attempts for failed calls
modeRetryMode”raise”Retry behavior: “raise” or “return_false”
debugboolFalseEnable debug mode for detailed logging
Example:
agent = Agent(
    model="openai/gpt-4o-mini",
    retry=5,
    mode="raise",
    debug=True
)

Company Context Attributes

AttributeTypeDefaultDescription
company_urlstr | NoneNoneCompany website URL
company_objectivestr | NoneNoneCompany’s main objective
company_descriptionstr | NoneNoneDetailed company description
Example:
agent = Agent(
    company_url="https://securebank.com",
    company_objective="Revolutionizing digital banking with AI",
    company_description="Leading provider of AI-powered financial services for retail and commercial clients"
)

Role and Professional Attributes

AttributeTypeDefaultDescription
rolestr | NoneNoneProfessional role of the agent
goalstr | NoneNonePrimary goal or objective
instructionsstr | NoneNoneSpecific instructions for behavior
educationstr | NoneNoneEducational background
work_experiencestr | NoneNoneProfessional experience
Example:
agent = Agent(
    role="Senior Financial Risk Analyst",
    goal="To provide accurate risk assessments and regulatory compliance analysis",
    instructions="Always follow banking regulations and provide detailed risk documentation",
    education="Finance and Risk Management Degree",
    work_experience="8 years in banking and financial risk analysis"
)

System and Context Attributes

AttributeTypeDefaultDescription
system_promptstr | NoneNoneCustom system prompt for the agent
reflectionstr | NoneNoneReflection capabilities configuration
compress_contextboolFalseEnable context compression
Example:
agent = Agent(
    system_prompt="You are a financial AI assistant specialized in banking operations and regulatory compliance. Always provide accurate, well-documented financial analysis and ensure compliance with banking regulations.",
    compress_context=True
)

Tool and Execution Attributes

AttributeTypeDefaultDescription
show_tool_callsboolTrueDisplay tool call information
tool_call_limitint5Maximum number of tool calls per execution
tool_call_countint0Current tool call count (read-only)
enable_thinking_toolboolFalseEnable thinking/reasoning capabilities
enable_reasoning_toolboolFalseEnable advanced reasoning (requires thinking)
Example:
agent = Agent(
    show_tool_calls=True,
    tool_call_limit=10,
    enable_thinking_tool=True,
    enable_reasoning_tool=True
)
Warning: enable_reasoning_tool requires enable_thinking_tool to be True. Setting reasoning without thinking will raise a ValueError.

Memory and Storage Attributes

AttributeTypeDefaultDescription
memoryMemory | NoneNoneMemory management system
feed_tool_call_resultsboolFalseInclude tool results in memory
Example:
from upsonic import Memory
from upsonic.storage.providers.sqlite import SqliteStorage

storage = SqliteStorage("sessions", "profiles", "agent_memory.db")
memory = Memory(
    storage=storage,
    session_id="session_001",
    user_id="user_001",
    full_session_memory=True,
    summary_memory=True,
    user_analysis_memory=True
)

agent = Agent(
    memory=memory,
    feed_tool_call_results=True
)

Safety and Reliability Attributes

AttributeTypeDefaultDescription
user_policyPolicy | NoneNonePolicy for user input validation
agent_policyPolicy | NoneNonePolicy for agent output validation
reliability_layerReliabilityProcessorNoneAdvanced content validation system
Example:
from upsonic.safety_engine.policies.crypto_policies import CryptoBlockPolicy
from upsonic.safety_engine.policies.phone_policies import AnonymizePhoneNumbersPolicy
from upsonic.reliability_layer.reliability_layer import ReliabilityProcessor

reliability_layer = ReliabilityProcessor(confidence_threshold=0.8)

agent = Agent(
    user_policy=CryptoBlockPolicy,
    agent_policy=AnonymizePhoneNumbersPolicy,
    reliability_layer=reliability_layer
)

Canvas and External Integration Attributes

AttributeTypeDefaultDescription
canvasCanvas | NoneNoneCanvas for persistent editing
Example:
from upsonic.canvas.canvas import Canvas

canvas = Canvas("financial_analysis_canvas")
agent = Agent(
    canvas=canvas
)
I