Repository navigation
feat(assistant): read connected mail, calendars and files from chat - #533
Merged
Merged
Conversation
An admin's assistant gets tools for the sources they connected under Settings › Sources: connections, search_mail, read_mail, calendar_events, list_files, find_files, read_file and import_from_connection. Only the tools for what is connected are offered. Reads run at once; bringing things into Lens waits for the person's yes through approvals. Messages and events are cited with a link that opens them, in the web app too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbBS222wEEQgkuui6CHo6c
…-sg6j7c # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbBS222wEEQgkuui6CHo6c
…-sg6j7c # Conflicts: # CHANGELOG.md # fastapi_backend/app/domain/ai_tools.py
…-sg6j7c # Conflicts: # CHANGELOG.md # docs/assistant.md # fastapi_backend/app/api/v1/routes/chats.py # fastapi_backend/app/domain/ai_tools.py # fastapi_backend/app/schemas/chats.py # nextjs-frontend/app/openapi-client/types.gen.ts # nextjs-frontend/components/chat/cite.ts # nextjs-frontend/components/recording/chat-tab.tsx # nextjs-frontend/openapi.json
21 of 23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: the sources an admin connected under Settings › Sources (Gmail and IMAP mailboxes, Google Calendar, S3, Drive and the other rclone storage) only fed imports. Asking the assistant "what did Mara send about the harbour?" or "what's on my calendar Friday?" went nowhere.
After: an admin's assistant has a "Mail, calendars and files" tool group with
connections,search_mail,read_mail,calendar_events,list_files,find_files,read_fileandimport_from_connection. Only the tools for what is connected are offered (no calendar connected, nocalendar_events), and non-admins see "for admins" in the tool catalog. Gmail is searched with its own query language, IMAP by words over the newest subjects and senders (the result says so); Google Calendar gives the events of a window; files are found by name through rclone and read when they are text, PDFs or Word files. Answers cite a message or an event with a link that opens it, in the web app too.import_from_connectiongoes through approvals like every other change.What each tool returns is wrapped as untrusted text, so a mail or a file that tries to steer the assistant marks the conversation wary and outbound tools wait, as web pages do today.
Motivation and Context
Part of "Chat tools for Gmail, Calendar, Drive, S3 and Bash" (project thread above). This is the read half; sending mail, adding events and writing files after a yes, and the Bash tool's node seam for remote sandboxes, follow in their own PRs.
Refine later (also in docs/assistant.md): server-side IMAP search, Drive full-text search, iCal feeds by time window, sharing a connection with non-admins.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
gmail.search,gmail.read,google.calendar,connections.*).import_from_connectionwaits for the yes; no default changed.test_connection_tools.py, a frontend citation test; docs, README, requirements and the OpenAPI client regenerated withmake openapi.gmail.py,gcal.py,feeds.py,sources.py(browse, stream, import_files),convert.parse_email,DOC_READERS,untrusted.wrap, the approvals flow and the web citation path.Generated by Claude Code