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
namestr | NoneNoneAgent name for identification
agent_id_str | NoneNoneUnique identifier for the agent instance
memoryMemory | NoneNoneMemory instance for conversation history
dbDatabaseBase | NoneNoneDatabase instance (overrides memory if provided)
debugboolFalseEnable debug logging
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_strategystr"none"Context compression method: ‘none’, ‘simple’, ‘llmlingua’
compression_settingsDict | NoneNoneSettings for compression strategy
reliability_layerAny | NoneNoneReliability layer for robustness
canvasCanvas | NoneNoneCanvas instance for visual interactions
retryint1Number of retry attempts
modestr"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_resultsboolFalseInclude 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
user_policyPolicy | List[Policy] | NoneNoneUser input safety policy
agent_policyPolicy | List[Policy] | NoneNoneAgent output safety policy
settingsModelSettings | NoneNoneModel-specific settings
profileModelProfile | NoneNoneModel profile configuration
reflection_configReflectionConfig | NoneNoneConfiguration for reflection
reasoning_effortstr | NoneNoneReasoning effort: ‘low’, ‘medium’, ‘high’ (OpenAI)
reasoning_summarystr | 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_formatstr | NoneNoneReasoning format: ‘hidden’, ‘raw’, ‘parsed’ (Groq)

Configuration Example

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

# Create storage and memory
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,
    model="openai/gpt-4o-mini"
)

# Create agent with configuration
agent = Agent(
    model="openai/gpt-4o",
    name="Assistant",
    memory=memory,
    debug=True,
    role="AI Assistant",
    goal="Help users with their questions",
    show_tool_calls=True,
    tool_call_limit=10
)

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