Metadata-Version: 2.1
Name: taskara
Version: 0.1.60
Summary: Task management for AI agents
License: MIT
Author: Patrick Barker
Author-email: patrickbarkerco@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: devicebay (>=0.1.21,<0.2.0)
Requires-Dist: pydantic (>=2.6.4,<3.0.0)
Requires-Dist: skillpacks (>=0.1.18,<0.2.0)
Requires-Dist: sqlalchemy (>=2.0.29,<3.0.0)
Requires-Dist: threadmem (>=0.2.26,<0.3.0)
Description-Content-Type: text/markdown

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <!-- <a href="https://github.com/agentsea/skillpacks">
    <img src="https://project-logo.png" alt="Logo" width="80">
  </a> -->

  <h1 align="center">Taskara</h1>

  <p align="center">
    Task management for AI agents
    <br />
    <a href="https://github.com/agentsea/threadmem"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://github.com/agentsea/threadmem">View Demo</a>
    ·
    <a href="https://github.com/agentsea/threadmem/issues">Report Bug</a>
    ·
    <a href="https://github.com/agentsea/threadmem/issues">Request Feature</a>
  </p>
  <br>
</p>

## Installation

```sh
pip install taskara
```

## Usage

Create a task

```python
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
task.assigned_to = "roko@agentsea.ai"
```

Post a message to the task thread

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

Create a custom thread for the task

```python
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
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
task.output = "The most common type of french duck is the Rouen"
task.status = "success"
```

Save the task

```python
task.save()
```

## 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
DB_TYPE=postgres
DB_NAME=taskara
DB_HOST=localhost
DB_USER=postgres
DB_PASS=abc123
```

