How davideluzi/mail-agent works
Neuron AI is a terminal email assistant: a user submits a request through the CLI, the agent consults an AI provider and dispatches registered tools, and tool results are returned to the conversation. For sending, the agent searches contacts first; if no match exists, it asks the user for an address before sending. Separate tools support adding and listing contacts. Contact data is stored in SQLite, while composed emails are appended to a local log rather than actually delivered. The README documents the flow; sampled source confirms tool-to-model calls and provider configuration.
Main entry points: MailAgent.php Mail agent · Contact.php Contact repository · chat.php Chat loop · SearchContactTool.php Search contact
Components 14
CLI interaction
- Chat loop
chat.php
Agent orchestration
- Mail agent
App/Agents/MailAgent.php - Configuration
App/Config.php
Contact management
- Search contact
App/Tools/SearchContactTool.php - Add contact
App/Tools/AddContactTool.php - List contacts
App/Tools/ListContactsTool.php - Contact repository
App/Models/Contact.php - Contacts SQLite
Email logging
- Send mail tool
App/Tools/SendMailTool.php - Email builder
App/Models/Email.php - Sent-mail log
Other components
- Terminal user
- Ollama
- Anthropic
Connections 16
- Terminal user → Chat loop: enters request
- Chat loop → Mail agent: submits message
- Mail agent → Chat loop: returns response
- Mail agent → Configuration: reads settings
- Mail agent → Ollama: requests inference
- Mail agent → Anthropic: requests inference
- Mail agent → Search contact: dispatches tool
- Mail agent → Add contact: dispatches tool
- Mail agent → List contacts: dispatches tool
- Mail agent → Send mail tool: dispatches tool
- Search contact → Contact repository: searches contacts
- Add contact → Contact repository: adds contact
- List contacts → Contact repository: lists contacts
- Contact repository → Contacts SQLite: reads and writes
- Send mail tool → Email builder: builds email
- Email builder → Sent-mail log: appends message