How openonion/email-agent works
Email Agent supports interactive and direct CLI use, natural-language email work, calendar scheduling, CRM/contact workflows, persistent memory, and HTTP hosting. The main runtime path is user input through the CLI or hosted agent, then agent tools and results. The graph also shows the distinct CLI command layer and CRM initialization sub-agent. README statements support documented integrations not visible in sampled calls; unsampled contact-provider internals and storage behavior are left unspecified.
Main entry points: agent.py Email agent · core.py CLI operations · commands.py CLI commands · interactive.py Interactive chat
Components 19
User interfaces
- CLI entry
cli.py - CLI commands
cli/commands.py - Interactive chat
cli/interactive.py - Contact autocomplete
cli/contacts_provider.py - CLI operations
cli/core.py - Setup checks
cli/setup.py - HTTP host entry
main.py
Agent runtime
- Email agent
agent.py - Daily briefing prompt
commands/today.md - Gmail instructions
prompts/gmail_agent.md
CRM and memory
- CRM initializer
agent.py - Agent memory
agent.py - Contact research
agent.py
External services
- Gmail tools
- Outlook tools
- Calendar tools
- LLM provider
- ConnectOnion host
Other components
- User
Connections 24
- User → CLI entry: runs
README.md - CLI entry → CLI commands: starts
cli.py - CLI commands → Setup checks: checks setup
cli/commands.py - CLI commands → Interactive chat: starts chat
cli/commands.py - CLI commands → CLI operations: dispatches
cli/commands.py - Interactive chat → Contact autocomplete: loads suggestions
cli/interactive.py - Interactive chat → CLI operations: runs commands
cli/interactive.py - Interactive chat → Email agent: sends chat
cli/interactive.py - CLI operations → Email agent: asks agent
cli/core.py - CLI operations → Gmail tools: uses email tools
cli/core.py - Email agent → Gmail tools: uses
agent.py - Email agent → Outlook tools: uses alternatively
agent.py - Email agent → Calendar tools: uses
README.md - Email agent → Agent memory: reads and writes
agent.py - CRM initializer → Agent memory: saves CRM context
agent.py - CRM initializer → Contact research: researches contacts
agent.py - Email agent → CRM initializer: invokes initializer
agent.py - CLI operations → Daily briefing prompt: loads prompt
cli/core.py - Email agent → Gmail instructions: uses instructions
agent.py - Email agent → LLM provider: reasons with
README.md - User → HTTP host entry: sends request
- HTTP host entry → ConnectOnion host: registers agent
main.py - HTTP host entry → Email agent: hosts
main.py - CLI operations → ConnectOnion host: starts server
cli/core.py