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

# Introduction

`taskara` is a task management system for your agents.

The main goal of this system is to keep track of your agent tasks and logs of their execution.
`surfkit` uses `taskara` under the hood to create and assign tasks, while the agents themselves
use it to record the log and report completion or failure.

## Installation

```
pip install taskara
```

## Usage

Create a task:

```python theme={null}
from taskara import Task

task = Task(
    description="Search for the most common varieties of french ducks",
    owner_id="delores@agentsea.ai"
)
```

Assign the task to an agent:

```python theme={null}
task.assigned_to = "roko@agentsea.ai"
```

Post a message to the task thread:

```python theme={null}
task.post_message("assistant", "Getting started working on this")
task.status = "in progress"
```

Create a custom thread for the task:

```python theme={null}
task.create_thread("debug")
task.post_message("assistant", "I'll post debug messages to this thread", thread="debug")
task.post_message("assistant", 'My current screenshot', images=["b64img"], thread="debug")
```

Store prompts used to accomplish the task:

```python theme={null}
thread = RoleThread()
thread.post(role="system", msg="I am a helpful assistant")

response = RoleMessage(
    role="assistant",
    text="How can I help?"
)
task.store_prompt(thread, response, namespace="actions")
```

Store the result:

```python theme={null}
task.output = "The most common type of french duck is the Rouen"
task.status = "success"
```

Save the task:

```python theme={null}
task.save()
```

## Tracker

`taskara` comes with a task tracker server which can be run on docker or kubernetes.

Install `surfkit` to create a tracker:

```
pip install surfkit
```

Create a tracker:

```
surfkit create tracker
```

List trackers:

```
surfkit list trackers
```

Get tracker logs:

```
surfkit logs tracker <name>
```

Create a task:

```
surfkit create task --description "Search for french ducks"
```

List tasks:

```
surfkit list tasks
```

Get a task:

```
surfkit get task <id>
```

## Integrations

Taskara is integrated with:

* [SurfKit](https://github.com/agentsea/surfkit) A platform for orchestrating AI agents.
* [MLLM](https://github.com/agentsea/mllm) A prompt management, routing, and schema validation library for multimodal LLMs.
* [Skillpacks](https://github.com/agentsea/skillpacks) A library to fine tune AI agents on tasks.
* [ThreadMem](https://github.com/agentsea/threadmem) A thread management library for AI agents.

## Backends

Thread and prompt storage can be backed by:

* Sqlite
* Postgresql

Sqlite will be used by default. To use postgres simply configure the env vars:

```sh theme={null}
DB_TYPE=postgres
DB_NAME=tasks
DB_HOST=localhost
DB_USER=postgres
DB_PASS=abc123
```

Thread image storage by default will utilize the db, to configure bucket storage using GCS:

* Create a bucket with fine grained permissions.
* Create a GCP service account JSON with permissions to write to the bucket.

```sh theme={null}
export THREAD_STORAGE_SA_JSON='{
  "type": "service_account",
  ...
}'
export THREAD_STORAGE_BUCKET=my-bucket
```
