# Agno Team keeps message roles, plus fixes for GmailTools and DuckDbTools

> An Agno Team given a list of messages now keeps each role, and GmailTools and DuckDbTools return the right email bodies and search order.

- Published: 2026-11-12
- Author: Yash Pratap Solanky
- Categories: Changelog
- Canonical: https://www.agno.com/blog/agno-team-keeps-message-roles-plus-fixes-for-gmailtools-and-duckdbtools
- Markdown: https://www.agno.com/blog/agno-team-keeps-message-roles-plus-fixes-for-gmailtools-and-duckdbtools.md

An Agno `Team` given a list of messages now keeps each message's role instead of squashing the conversation into one user message. This release also fixes empty email bodies in `GmailTools` and the result order of `DuckDbTools` full-text search. Each fix ran without a model key on the earlier release and this one, and the output below is real.

## Team keeps message roles and media

`Team.run()` with a list of `Message` objects or role dicts now sends each message with its role, the way an `Agent` does. Earlier releases joined the user turns into one string and dropped the assistant turns. Images, audio, video and files you pass with the list go on the last user message. The release's own recording model stood in for OpenAI to capture what the team sent:

```python
team.run(
    [
        Message(role="user", content="stored question"),
        Message(role="assistant", content="stored answer"),
        Message(role="user", content="current question"),
    ],
    images=[Image(url="https://example.com/cat.png")],
)
```

```text
# Before
[('user', 'stored question\ncurrent question', ['https://example.com/cat.png'])]

# Now
[('user', 'stored question', []), ('assistant', 'stored answer', []), ('user', 'current question', ['https://example.com/cat.png'])]
```

Memory updates read only the run's own list input, so few-shot `additional_input` examples never reach the memory manager as things the user said. The memory model gets the user and assistant text with tool calls stripped, so it never receives a tool result without the call that produced it.

## GmailTools list calls return the body

`get_latest_emails`, `search_emails` and the other `GmailTools` list calls read only top-level `text/plain` parts, so an HTML-only email or one nested in `multipart/mixed` came back with an empty body. They now use the same MIME parser as `get_message`, which honors `include_html` and `max_body_length`. A `MagicMock` stood in for the Gmail API with a nested HTML message and a PDF attachment:

```text
# Before
'\n\nAttachments: report.pdf'

# Now
'Hello Agno\n\nAttachments: report.pdf'
```

## DuckDbTools ranks the best match first

`DuckDbTools.full_text_search` sorted by BM25 score in ascending order, so the weakest match came back first. It now sorts by `score DESC`. This run used DuckDB's real full-text index on DuckDB 1.5:

```text
# Before
first row: 0.1694580988086923, "a duck walks into a pond near the river bank"

# Now
first row: 0.3277839137540398, "duck duck duck"
```

See the [DuckDB tools cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/duckdb_tools.py), and learn more about [running teams](https://docs.agno.com/teams/running-teams), [Gmail](https://docs.agno.com/tools/toolkits/social/gmail) and [DuckDB](https://docs.agno.com/tools/toolkits/database/duckdb) in the documentation.
