Run an enrollment agent from a... Note

Run an enrollment agent from a school's admissions inbox

Admissions inboxes are often filled with repetitive questions and documents, which can be time-consuming to manage. A human typically reads each email, looks up the applicant in the student information system, checks for outstanding documents, and writes a response. However, this process can be automated using an agent account with a language model. The agent account is a grant that allows an application to own a first-class inbox, enabling it to send and receive emails without a human mailbox. To create an agent account, a POST request is made to the Nylas API with the provider, name, and email settings. The API auto-provisions a default workspace and policy for the account, and a custom policy can be attached later if needed. The agent account has its own identity and can send emails under its own address, receive replies in its own thread, and hold application state for every applicant. The brains of the operation, including classifying questions and deciding which checklist items are satisfied, are handled by the application code and language model. The Nylas API provides the mail plane, including receiving messages, fetching bodies, downloading attachments, and sending replies and reminders. The application database stores the per-applicant record, which includes documents received, outstanding documents, deadlines, and last reminders sent.Inbound email to the agent fires a standard message-created webhook, which is application-scoped, not grant-scoped. The webhook handler responds immediately, verifies the signature, and deduplicates events. The full message is fetched when needed, and the message is marked as read separately. The conversation chain can be pulled using the thread endpoint, and the language model classifies the inbound message and composes an answer from the FAQ corpus and applicant record.The API call to send a reply is made with the reply-to-message-id set to the message being answered, and the CLI version is shorter because it fetches the original to fill in recipient and subject. The agent's job is to pull down documents, figure out which checklist item they satisfy, and update the applicant's record. A fetched message lists its attachments with ids, and a downloaded attachment requires the message-id query parameter. The metadata endpoint takes the same message-id query parameter, and the logic to classify the document and update the checklist item is handled by the application. The cadence of sending deadline reminders is handled by the application code, which wakes up on a schedule, queries the database for applicants who are missing documents, and sends reminders accordingly. The Nylas API provides the necessary endpoints to send emails and track submitted application documents, and the application code handles the logic and decision-making.