Agno Team keeps message roles, plus fixes for GmailTools and DuckDbTools
November 12, 20261 min read
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:
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")],
)# 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:
# 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:
# 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, and learn more about running teams, Gmail and DuckDB in the documentation.
Frequently asked questions
Yes. team.run(["first line", "second line"]) still sends one user message, "first line\nsecond line". Only lists of Message objects or role dicts keep their roles.
Agno attaches them to the last user message in the list. It copies that message first, so a Message you reuse across runs doesn't pile up media. With send_media_to_model=False the media stays off, and a list with no user message logs a warning.
Every list call that returns message details uses it, such as get_latest_emails, get_unread_emails, search_emails, get_starred_emails and get_emails_by_thread. They honor include_html and max_body_length and still append the attachment names.
Earlier releases sorted by BM25 score in ascending order, so a response read 0.1694580988086923,1,a duck walks into a pond near the river bank ahead of 0.3277839137540398,2,duck duck duck. This release sorts by score DESC, so upgrade to get the best match first.




