English version below / 英語版は下にあります
LangGraph、LangChain、Azure OpenAIを使用して構築されたAIパワードメールアシスタントで、自動トリアージ、応答生成、メモリベースの学習を通じてユーザーのメール管理をサポートします。
emailAssistance/
├── docs/ # ドキュメンテーション
│ ├── technical_blog_english.md
│ └── technical_blog_japanese.md
├── logs/ # ログファイル
│ └── email_logs/ # メール特有のログ
├── scripts/ # アプリケーション実行用スクリプト
│ └── run.sh # メイン実行スクリプト
├── src/ # ソースコード
│ ├── app/ # ウェブインターフェース
│ │ ├── __init__.py
│ │ └── interface.py # Gradioインターフェース
│ ├── core/ # コアアプリケーションロジック
│ │ ├── __init__.py
│ │ ├── config.py # 設定
│ │ ├── models.py # データモデル
│ │ └── prompts.py # システムプロンプト
│ ├── memory/ # メモリ管理
│ │ ├── __init__.py
│ │ └── manager.py # メモリ操作
│ ├── tools/ # エージェントツール
│ │ ├── __init__.py
│ │ ├── actions.py # メールとカレンダーツール
│ │ └── memory.py # メモリツール
│ ├── utils/ # ユーティリティ関数
│ │ ├── __init__.py
│ │ └── logger.py # ロギング機能
│ ├── workflow/ # LangGraphワークフロー
│ │ ├── __init__.py
│ │ ├── graph.py # ワークフロー定義
│ │ ├── response.py # レスポンスエージェント
│ │ └── triage.py # トリアージ機能
│ ├── __init__.py # パッケージマーカー
│ └── main.py # エントリーポイント
├── .env # 環境変数(作成する必要があります)
└── requirements.txt # 依存関係
- メールトリアージ: 受信メールを自動的に「無視」、「通知」、または「応答」に分類
- レスポンス生成: メールに対して文脈に適した返信を作成
- カレンダー管理: 予定の確認と会議のスケジュール
- メモリシステム: インタラクションから学習し、時間とともに改善:
- セマンティックメモリ: 事実とユーザーの好みを保存
- エピソードメモリ: 過去の例から学習
- 手続き的メモリ: フィードバックに基づいて動作を更新
Python 3.11以上が必要です。プロジェクトをセットアップするには、次の手順に従ってください:
-
リポジトリをクローン:
git clone https://github.com/givery-technology/ai-lab-email-assistant.git cd ai-lab-email-assistant
-
仮想環境の作成と有効化:
python -m venv venv source venv/bin/activate
-
依存関係のインストール:
pip install -r requirements.txt
-
Azure OpenAI認証情報を含む
.env
ファイルを作成:AZURE_OPENAI_ENDPOINT=your_endpoint AZURE_OPENAI_API_KEY=your_api_key AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name AZURE_OPENAI_API_VERSION=2023-05-15 AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=your_embedding_model
提供されているスクリプトを使用してアプリケーションを実行:
./scripts/run.sh
または、Pythonから直接実行:
python -m src.main
これによりGradioウェブインターフェースが起動し、ブラウザで http://localhost:7860 からアクセスできます。
プロジェクトは以下のモジュールに整理されています:
app
: Gradioを使用したウェブインターフェースcore
: 構成やデータモデルなどの基本コンポーネントmemory
: メモリ管理機能tools
: メール、カレンダー、メモリ操作用のエージェントツールutils
: ユーティリティ関数とロギングworkflow
: LangGraphワークフロー定義
An AI-powered email assistant built with LangGraph, LangChain, and Azure OpenAI that helps users manage their emails through automated triage, response generation, and memory-based learning.
emailAssistance/
├── docs/ # Documentation
│ ├── technical_blog_english.md
│ └── technical_blog_japanese.md
├── logs/ # Log files
│ └── email_logs/ # Email specific logs
├── scripts/ # Scripts for running the application
│ └── run.sh # Main run script
├── src/ # Source code
│ ├── app/ # Web interface
│ │ ├── __init__.py
│ │ └── interface.py # Gradio interface
│ ├── core/ # Core application logic
│ │ ├── __init__.py
│ │ ├── config.py # Configuration
│ │ ├── models.py # Data models
│ │ └── prompts.py # System prompts
│ ├── memory/ # Memory management
│ │ ├── __init__.py
│ │ └── manager.py # Memory operations
│ ├── tools/ # Agent tools
│ │ ├── __init__.py
│ │ ├── actions.py # Email and calendar tools
│ │ └── memory.py # Memory tools
│ ├── utils/ # Utility functions
│ │ ├── __init__.py
│ │ └── logger.py # Logging functionality
│ ├── workflow/ # LangGraph workflow
│ │ ├── __init__.py
│ │ ├── graph.py # Workflow definition
│ │ ├── response.py # Response agent
│ │ └── triage.py # Triage functionality
│ ├── __init__.py # Package marker
│ └── main.py # Entry point
├── .env # Environment variables (create this)
└── requirements.txt # Dependencies
- Email Triage: Automatically classify incoming emails as 'ignore', 'notify', or 'respond'
- Response Generation: Create contextually appropriate replies for emails
- Calendar Management: Check availability and schedule meetings
- Memory System: Learn from interactions and improve over time:
- Semantic Memory: Store facts and user preferences
- Episodic Memory: Learn from past examples
- Procedural Memory: Update behavior based on feedback
Python 3.11 or higher is required. Follow these steps to set up the project:
-
Clone the repository:
git clone https://github.com/givery-technology/ai-lab-email-assistant.git cd ai-lab-email-assistant
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file with your Azure OpenAI credentials:AZURE_OPENAI_ENDPOINT=your_endpoint AZURE_OPENAI_API_KEY=your_api_key AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name AZURE_OPENAI_API_VERSION=2023-05-15 AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=your_embedding_model
Run the application using the provided script:
./scripts/run.sh
Or directly with Python:
python -m src.main
This will start the Gradio web interface, which you can access in your browser at http://localhost:7860.
The project is organized into modules:
app
: Web interface with Gradiocore
: Essential components like configuration and data modelsmemory
: Memory management functionalitytools
: Agent tools for email, calendar, and memory operationsutils
: Utility functions and loggingworkflow
: LangGraph workflow definition