Skip to main content

Attributes

The Agent system is configured through the Agent class, which provides the following attributes:
AttributeTypeDefaultDescription
modelstr | Model"openai/gpt-4o"Model identifier or Model instance
model_namestr(from model)Original model identifier string (set from model parameter)
namestr | NoneNoneAgent name for identification
memoryMemory | NoneNoneMemory instance for conversation history
dbDatabaseBase | NoneNoneDatabase instance (overrides memory if provided)
session_idstr | NoneNoneSession identifier for conversation tracking
user_idstr | NoneNoneUser identifier for multi-user scenarios
debugboolFalseEnable debug logging
debug_levelint1Debug level (1 = standard, 2 = detailed). Only used when debug=True
company_urlstr | NoneNoneCompany URL for context
company_objectivestr | NoneNoneCompany objective for context
company_descriptionstr | NoneNoneCompany description for context
company_namestr | NoneNoneCompany name for context
system_promptstr | NoneNoneCustom system prompt
reflectionboolFalseEnable reflection capabilities
compression_strategyLiteral[“none”, “simple”, “llmlingua”]"none"Context compression method: ‘none’, ‘simple’, ‘llmlingua’
compression_settingsDict[str, Any] | NoneNoneSettings for compression strategy
reliability_layerAny | NoneNoneReliability layer for robustness
agent_id_str | NoneNoneUnique identifier for the agent instance
canvasCanvas | NoneNoneCanvas instance for visual interactions
retryint1Number of retry attempts
modeRetryMode"raise"Retry mode behavior: ‘raise’ or ‘return_false’
rolestr | NoneNoneAgent role
goalstr | NoneNoneAgent goal
instructionsstr | NoneNoneSpecific instructions
educationstr | NoneNoneAgent education background
work_experiencestr | NoneNoneAgent work experience
feed_tool_call_resultsbool | NoneNoneInclude tool results in memory
show_tool_callsboolTrueDisplay tool calls
tool_call_limitint5Maximum tool calls per execution
enable_thinking_toolboolFalseEnable orchestrated thinking
enable_reasoning_toolboolFalseEnable reasoning capabilities
toolsList[Any] | NoneNoneAgent-level tools (can also be added via add_tools())
user_policyPolicy | List[Policy] | NoneNoneUser input safety policy
agent_policyPolicy | List[Policy] | NoneNoneAgent output safety policy
tool_policy_prePolicy | List[Policy] | NoneNoneTool safety policy for pre-execution validation
tool_policy_postPolicy | List[Policy] | NoneNoneTool safety policy for post-execution validation
user_policy_feedbackboolFalseEnable feedback loop for user policy violations
agent_policy_feedbackboolFalseEnable feedback loop for agent policy violations
user_policy_feedback_loopint1Maximum retry count for user policy feedback
agent_policy_feedback_loopint1Maximum retry count for agent policy feedback
settingsModelSettings | NoneNoneModel-specific settings
profileModelProfile | NoneNoneModel profile configuration
reflection_configReflectionConfig | NoneNoneConfiguration for reflection
model_selection_criteriaDict[str, Any] | NoneNoneDefault criteria for recommend_model_for_task()
use_llm_for_selectionboolFalseUse LLM in recommend_model_for_task()
reasoning_effortLiteral[“low”, “medium”, “high”] | NoneNoneReasoning effort: ‘low’, ‘medium’, ‘high’ (OpenAI)
reasoning_summaryLiteral[“concise”, “detailed”] | NoneNoneReasoning summary: ‘concise’, ‘detailed’ (OpenAI)
thinking_enabledbool | NoneNoneEnable thinking (Anthropic/Google)
thinking_budgetint | NoneNoneToken budget for thinking
thinking_include_thoughtsbool | NoneNoneInclude thoughts in output (Google)
reasoning_formatLiteral[“hidden”, “raw”, “parsed”] | NoneNoneReasoning format: ‘hidden’, ‘raw’, ‘parsed’ (Groq)
culture_managerCultureManager | NoneNoneCulture manager instance for cultural knowledge (experimental)
add_culture_to_contextboolFalseAdd cultural knowledge to context (experimental)
update_cultural_knowledgeboolFalseUpdate cultural knowledge based on interactions (experimental)
enable_agentic_cultureboolFalseEnable agentic culture capabilities (experimental)
metadataDict[str, Any] | NoneNoneAgent metadata (passed to prompt)

Properties

The Agent class provides the following read-only properties:
PropertyTypeDescription
agent_idstrUnique agent identifier (auto-generated if not provided via agent_id_)
session_idstr | NoneSession identifier (from override, memory, or db)
user_idstr | NoneUser identifier (from override, memory, or db)

Configuration Example

from upsonic import Agent, Task
from upsonic.storage.providers.sqlite import SqliteStorage
from upsonic.storage import Memory

# Create storage and memory
storage = SqliteStorage(
    db_file="agent_memory.db",
    agent_sessions_table_name="sessions"
)

memory = Memory(
    storage=storage,
    session_id="session_001",
    user_id="user_001",
    full_session_memory=True,
    summary_memory=True,
    model="openai/gpt-4o-mini"
)

# Create agent with configuration
agent = Agent(
    model="anthropic/claude-sonnet-4-5",
    name="Assistant",
    memory=memory,
    debug=True,
    role="AI Assistant",
    goal="Help users with their questions",
    show_tool_calls=True,
    tool_call_limit=5
)

# Execute a task
task = Task("Hello! What can you help me with?")
result = agent.do(task)
print(result)