> ## 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.

# Tasks

> Let's analyze how Upsonic Tasks works

<img src="https://mintcdn.com/upsonic/lEfVQiA3d4Ew-NMK/images/concepts-task.png?fit=max&auto=format&n=lEfVQiA3d4Ew-NMK&q=85&s=e6e74a9fd52d4685ddd2f0d14dd0f301" alt="Concepts Task" width="1728" height="573" data-path="images/concepts-task.png" />

Detailed guide on managing and creating tasks within the Upsonic framework.

## Overview

In the Upsonic framework, a `Task` is a specific assignment completed by an `Agent`. Tasks provide all necessary details for execution, such as a description, tools, response format, caching options, and more, facilitating a wide range of action complexities. Tasks within Upsonic can be collaborative, requiring multiple agents to work together through context sharing and task dependencies. Tasks are executed by agents in a single-threaded manner, with each task processed sequentially. The execution flow includes task validation, context processing, tool processing, agent execution, response processing, and caching.

## Key Features

* **Flexible Description**: Define what needs to be done in natural language
* **Tool Integration**: Attach specific tools the agent can use
* **Structured Output**: Define response format using Pydantic models
* **Context Support**: Add files, images, or other tasks as context
* **Caching**: Built-in caching for repeated executions
* **Guardrails**: Validate output before accepting results

## Example

```python theme={null}
from upsonic import Agent, Task

# Create agent and task
agent = Agent("anthropic/claude-sonnet-4-5")
task = Task("Calculate the square root of 144")

# Execute task
agent.print_do(task)
# agent.do(task)
```

## Navigation

* [Task Attributes](https://docs.upsonic.ai/concepts/tasks/attributes) - Core and advanced configuration options
* [Creating a Task](https://docs.upsonic.ai/concepts/tasks/creating-task) - Detailed task creation examples
* [Adding Tools to a Task](https://docs.upsonic.ai/concepts/tasks/adding-tools) - Tool integration and configuration
* [Adding Tasks to Other Tasks as Context](https://docs.upsonic.ai/concepts/tasks/context-management/adding-tasks-to-other-tasks-as-context) - Task chaining and workflows
* [Putting Knowledge Base to Task](https://docs.upsonic.ai/concepts/tasks/context-management/adding-knowledge-base-to-task-context) - RAG integration
* [Putting Images to Tasks](https://docs.upsonic.ai/concepts/tasks/context-management/adding-images-to-task-context) - Image processing capabilities
* [Response Format](https://docs.upsonic.ai/concepts/tasks/response-format) - Output formatting options
* [Accessing Task Results](https://docs.upsonic.ai/concepts/tasks/results) - Result retrieval and metadata
