> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Attributes

> Configuration options for the Agent system

## Attributes

The Agent system is configured through the `Agent` class, which provides the following attributes:

| Attribute                    | Type                                        | Default           | Description                                                         |
| ---------------------------- | ------------------------------------------- | ----------------- | ------------------------------------------------------------------- |
| `model`                      | str \| Model                                | `"openai/gpt-4o"` | Model identifier or Model instance                                  |
| `model_name`                 | str                                         | (from `model`)    | Original model identifier string (set from `model` parameter)       |
| `name`                       | str \| None                                 | `None`            | Agent name for identification                                       |
| `memory`                     | Memory \| None                              | `None`            | Memory instance for conversation history                            |
| `db`                         | DatabaseBase \| None                        | `None`            | Database instance (overrides memory if provided)                    |
| `session_id`                 | str \| None                                 | `None`            | Session identifier for conversation tracking                        |
| `user_id`                    | str \| None                                 | `None`            | User identifier for multi-user scenarios                            |
| `debug`                      | bool                                        | `False`           | Enable debug logging                                                |
| `debug_level`                | int                                         | `1`               | Debug level (1 = standard, 2 = detailed). Only used when debug=True |
| `company_url`                | str \| None                                 | `None`            | Company URL for context                                             |
| `company_objective`          | str \| None                                 | `None`            | Company objective for context                                       |
| `company_description`        | str \| None                                 | `None`            | Company description for context                                     |
| `company_name`               | str \| None                                 | `None`            | Company name for context                                            |
| `system_prompt`              | str \| None                                 | `None`            | Custom system prompt                                                |
| `reflection`                 | bool                                        | `False`           | Enable reflection capabilities                                      |
| `compression_strategy`       | Literal\["none", "simple", "llmlingua"]     | `"none"`          | Context compression method: 'none', 'simple', 'llmlingua'           |
| `compression_settings`       | Dict\[str, Any] \| None                     | `None`            | Settings for compression strategy                                   |
| `reliability_layer`          | Any \| None                                 | `None`            | Reliability layer for robustness                                    |
| `agent_id_`                  | str \| None                                 | `None`            | Unique identifier for the agent instance                            |
| `canvas`                     | Canvas \| None                              | `None`            | Canvas instance for visual interactions                             |
| `retry`                      | int                                         | `1`               | Number of retry attempts                                            |
| `mode`                       | RetryMode                                   | `"raise"`         | Retry mode behavior: 'raise' or 'return\_false'                     |
| `role`                       | str \| None                                 | `None`            | Agent role                                                          |
| `goal`                       | str \| None                                 | `None`            | Agent goal                                                          |
| `instructions`               | str \| None                                 | `None`            | Specific instructions                                               |
| `education`                  | str \| None                                 | `None`            | Agent education background                                          |
| `work_experience`            | str \| None                                 | `None`            | Agent work experience                                               |
| `feed_tool_call_results`     | bool \| None                                | `None`            | Include tool results in memory                                      |
| `show_tool_calls`            | bool                                        | `True`            | Display tool calls                                                  |
| `tool_call_limit`            | int                                         | `5`               | Maximum tool calls per execution                                    |
| `enable_thinking_tool`       | bool                                        | `False`           | Enable orchestrated thinking                                        |
| `enable_reasoning_tool`      | bool                                        | `False`           | Enable reasoning capabilities                                       |
| `tools`                      | List\[Any] \| None                          | `None`            | Agent-level tools (can also be added via `add_tools()`)             |
| `user_policy`                | Policy \| List\[Policy] \| None             | `None`            | User input safety policy                                            |
| `agent_policy`               | Policy \| List\[Policy] \| None             | `None`            | Agent output safety policy                                          |
| `tool_policy_pre`            | Policy \| List\[Policy] \| None             | `None`            | Tool safety policy for pre-execution validation                     |
| `tool_policy_post`           | Policy \| List\[Policy] \| None             | `None`            | Tool safety policy for post-execution validation                    |
| `user_policy_feedback`       | bool                                        | `False`           | Enable feedback loop for user policy violations                     |
| `agent_policy_feedback`      | bool                                        | `False`           | Enable feedback loop for agent policy violations                    |
| `user_policy_feedback_loop`  | int                                         | `1`               | Maximum retry count for user policy feedback                        |
| `agent_policy_feedback_loop` | int                                         | `1`               | Maximum retry count for agent policy feedback                       |
| `settings`                   | ModelSettings \| None                       | `None`            | Model-specific settings                                             |
| `profile`                    | ModelProfile \| None                        | `None`            | Model profile configuration                                         |
| `reflection_config`          | ReflectionConfig \| None                    | `None`            | Configuration for reflection                                        |
| `model_selection_criteria`   | Dict\[str, Any] \| None                     | `None`            | Default criteria for recommend\_model\_for\_task()                  |
| `use_llm_for_selection`      | bool                                        | `False`           | Use LLM in recommend\_model\_for\_task()                            |
| `reasoning_effort`           | Literal\["low", "medium", "high"] \| None   | `None`            | Reasoning effort: 'low', 'medium', 'high' (OpenAI)                  |
| `reasoning_summary`          | Literal\["concise", "detailed"] \| None     | `None`            | Reasoning summary: 'concise', 'detailed' (OpenAI)                   |
| `thinking_enabled`           | bool \| None                                | `None`            | Enable thinking (Anthropic/Google)                                  |
| `thinking_budget`            | int \| None                                 | `None`            | Token budget for thinking                                           |
| `thinking_include_thoughts`  | bool \| None                                | `None`            | Include thoughts in output (Google)                                 |
| `reasoning_format`           | Literal\["hidden", "raw", "parsed"] \| None | `None`            | Reasoning format: 'hidden', 'raw', 'parsed' (Groq)                  |
| `culture_manager`            | CultureManager \| None                      | `None`            | Culture manager instance for cultural knowledge (experimental)      |
| `add_culture_to_context`     | bool                                        | `False`           | Add cultural knowledge to context (experimental)                    |
| `update_cultural_knowledge`  | bool                                        | `False`           | Update cultural knowledge based on interactions (experimental)      |
| `enable_agentic_culture`     | bool                                        | `False`           | Enable agentic culture capabilities (experimental)                  |
| `metadata`                   | Dict\[str, Any] \| None                     | `None`            | Agent metadata (passed to prompt)                                   |

## Properties

The Agent class provides the following read-only properties:

| Property     | Type        | Description                                                              |
| ------------ | ----------- | ------------------------------------------------------------------------ |
| `agent_id`   | str         | Unique agent identifier (auto-generated if not provided via `agent_id_`) |
| `session_id` | str \| None | Session identifier (from override, memory, or db)                        |
| `user_id`    | str \| None | User identifier (from override, memory, or db)                           |

## Configuration Example

```python theme={null}
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-6",
    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)
```
