Orion is a sophisticated, autonomous AI assistant designed to manage your complete digital workflow. It seamlessly integrates email management and task creation, acting as a true partner to help you stay organized and productive.
In today's fast-paced digital world, managing the constant flow of emails and the tasks that arise from them is a significant challenge. Orion solves this problem by providing a unified, intelligent system that not only triages and responds to your emails but also automatically creates and manages a corresponding To-Do list.
Built with a powerful multi-agent architecture, Orion learns from your feedback to adapt to your personal style and priorities, making it more than just a tool—it's a personalized assistant.
- Autonomous Email Management: Orion connects to your Gmail inbox, automatically triaging emails into categories:
respond,notify, orignore. - Intelligent Response Generation: For emails that require a response, Orion can draft replies, schedule meetings using the Google Calendar API, and handle back-and-forth communication.
- Integrated Task Management: Orion identifies actionable items from your emails and automatically creates tasks in a persistent To-Do list, bridging the gap between communication and action.
- Adaptive Learning (RAG + HITL): Through a Human-in-the-Loop (HITL) interface, you can approve, edit, or reject Orion's actions. Every interaction teaches Orion, updating its "memory" to better match your preferences for communication and task management.
Orion is built using LangGraph to orchestrate a stateful, multi-agent system. This modular design allows for complex, multi-step reasoning and action.
-
Unified Agent (
unified_agent.py): This is the master router. It receives all incoming data (new emails or user commands) and directs it to the appropriate specialized agent. -
Email Assistant (
email_assistant_hitl_memory_gmail.py): This sub-agent manages all email-related activities. It uses an LLM to understand email content, classify it, and use tools likesend_email_toolandschedule_meeting_toolto interact with Google services. -
Task Manager (
task_maistro.py): This sub-agent is the task management expert. It maintains the user's To-Do list, adding new tasks, updating their status, and storing them in a persistent memory. -
The Bridge (
email_to_todo_bridge): This crucial node connects the two agents. After the Email Assistant processes an important email, the bridge extracts the context and transforms it into a structured command for the Task Manager, enabling seamless, automatic task creation. -
Adaptive Memory (RAG): User feedback from the HITL process is used to update a knowledge base of "user preferences." Before taking any action, Orion retrieves relevant preferences from this memory, allowing it to personalize its behavior over time.
- Backend: Python
- AI Orchestration: LangChain & LangGraph
- LLMs: OpenAI (GPT-4 and others)
- APIs: Google Gmail API, Google Calendar API
Follow these steps to set up and run your own instance of Orion.
- Python 3.9+
- An OpenAI API Key
- A Google Cloud Project with the Gmail API and Calendar API enabled.
git clone https://github.com/your-username/orion.git
cd orionIt's recommended to use a virtual environment.
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txtOrion needs credentials to access your Google account securely.
-
From your Google Cloud Project, download your OAuth 2.0 Client ID credentials as a JSON file.
-
Save this file in the project at the following path:
src/email_assistant/tools/gmail/.secrets/secrets.json. -
Run the setup script. This will open a browser window for you to authenticate with your Google account and grant permissions.
python src/email_assistant/tools/gmail/setup_gmail.py
After successful authentication, a
token.jsonfile will be created in the.secretsdirectory.
Create a .env file in the root of the project and add your OpenAI API key.
OPENAI_API_KEY="your-openai-api-key"
Orion will automatically load this key.
You can trigger a one-time scan of your inbox to process recent emails.
python src/email_assistant/tools/gmail/run_ingest.py --email "your-email@gmail.com" --minutes-since 60--email: The email address Orion should manage.--minutes-since: How far back to look for emails (in minutes).
For continuous, automated operation, you can set up a LangGraph cron job that periodically triggers the ingestion script.
python src/email_assistant/tools/gmail/setup_cron.py --email "your-email@gmail.com" --url "http://127.0.0.1:2024" --schedule "*/10 * * * *"--schedule: The cron schedule (e.g., "every 10 minutes").
Contributions are welcome! If you'd like to help improve Orion, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.

