Skip to content

Commit 36d32b3

Browse files
authored
Merge pull request #1664 from oracle-devrel/omarsalemassistantagent
Update readme.md
2 parents 7a1a466 + 3dc4f6c commit 36d32b3

File tree

1 file changed

+133
-62
lines changed
  • ai/gen-ai-agents/assistant-secretary-agent

1 file changed

+133
-62
lines changed
Lines changed: 133 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,156 @@
1-
Assistant Secretary Agent
2-
By Omar Salem
1+
# Assistant Secretary Agent
32

4-
Assistant Secretary Agent is a powerful AI chatbot that dynamically routes user input to different tools including mail, Google Calendar, Weather, Calculator, and OCI GenAI (Cohere) for general questions and OCI AI Agent RAG-based answers. It includes a Streamlit UI and supports multi-tool workflows like reading emails, summarizing, replying, scheduling meetings, fetching weather, and more.
3+
*An AI-powered assistant that routes user input across tools like Gmail, Google Calendar, Weather API, Calculator, and Oracle’s Generative AI services for smart, dynamic task automation.*
54

6-
Reviewed: March 31, 2025
5+
Reviewed: 31.03.2025
76

8-
1. Prepare Your Credentials
9-
Google API (Gmail + Calendar)
10-
Go to: Google Cloud Console
7+
---
118

12-
Enable Gmail API and Calendar API
9+
## When to use this asset?
1310

14-
Create OAuth 2.0 credentials and download credentials.json
11+
Use this asset when you want to:
12+
- Automate tasks across Gmail, Calendar, and Weather
13+
- Get answers via OCI’s AI Agents and RAG-powered chat
14+
- Use a simple UI to interact with multiple tools seamlessly
15+
- Demo a multi-tool assistant combining local logic and cloud intelligence
1516

16-
Place it in the project root directory
17+
Ideal for:
18+
- AI developers building assistants
19+
- Oracle consultants showcasing GenAI + agent capabilities
20+
- Technical users exploring LLM + API routing in real-world use cases
1721

18-
The first time you run the assistant, a token.json will be created automatically after login.
22+
---
1923

20-
☁️ OCI Generative AI (Cohere on OCI)
21-
Go to: OCI Console → Generative AI
24+
## How to use this asset?
2225

23-
Select a model like cohere.command-r-plus-08-2024
26+
This assistant can be launched via:
27+
- **Terminal (CLI mode)**
28+
- **Streamlit UI** for visual interaction
2429

25-
Copy:
30+
It supports:
31+
- Reading and replying to emails
32+
- Summarizing or replying smartly using GenAI
33+
- Scheduling calendar events
34+
- Fetching and advising based on weather
35+
- Answering user queries via RAG and fallback GenAI tools
2636

27-
model_id
37+
---
2838

29-
compartment_id
39+
## Setup Instructions
3040

31-
endpoint (e.g., https://inference.generativeai.us-chicago-1.oci.oraclecloud.com)
41+
### 🔑 Google API (Gmail + Calendar)
42+
1. Go to **[Google Cloud Console](https://console.cloud.google.com)**
43+
2. Enable the **Gmail API** and **Calendar API**
44+
3. Create **OAuth 2.0 Credentials** and download `credentials.json`
45+
4. Place `credentials.json` in your project root
46+
5. The first time you run the assistant, a `token.json` will be created automatically
3247

33-
Paste them in oci_models.py
48+
---
3449

35-
https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm
36-
Do the same for the OCI AI AGENT endpoint. Create an AI Agent with a knowledge base and add your RAG documents in that knowledge base.
50+
### ☁️ OCI Generative AI (Cohere on OCI)
51+
1. Go to **OCI Console → Generative AI**
52+
2. Select a model like `cohere.command-r-plus-08-2024`
53+
3. Copy the following values:
54+
- `model_id`
55+
- `compartment_id`
56+
- `endpoint` (e.g., `https://inference.generativeai.us-chicago-1.oci.oraclecloud.com`)
57+
4. Paste these in `oci_models.py`
3758

38-
Weather API
39-
Get a free API key from: weatherapi.com
59+
🔗 [OCI GenAI Agent Guide](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm)
4060

41-
Add the key to tools.py in:
61+
Also create an **AI Agent** in OCI with a knowledge base, and upload your RAG documents into that knowledge base.
4262

43-
python
44-
Copy
45-
Edit
63+
---
4664

65+
### 🌦️ Weather API
66+
1. Sign up at [weatherapi.com](https://www.weatherapi.com/)
67+
2. Get a free API key
68+
3. In `tools.py`, update this line with your key:
69+
```python
4770
WEATHER_API_KEY = "your_api_key_here"
71+
```
4872

49-
2. Start the Chatbot
50-
Terminal Mode
51-
bash
52-
Copy
53-
Edit
73+
---
74+
75+
### 💬 Start the Assistant
76+
77+
**Terminal Mode**
78+
```bash
5479
python assistant.py
55-
Streamlit UI
56-
bash
57-
Copy
58-
Edit
59-
streamlit run ui.py
60-
You’ll see the full chat interface with interactive steps and decision routing.
61-
62-
3. Key Features
63-
Tool Description
64-
Fetch Gmail Retrieves unread emails, summarizes them
65-
Select Email Lets you read the full email body
66-
OCI AI Agent (RAG) Provides answers from RAG agent based on sender's country
67-
Smart Replies Generates professional replies using OCI GenAI
68-
Send Email Sends reply to the original sender
69-
Schedule Emails Delay sending with background job
70-
Weather + Advice Current weather or forecast with clothing tips
71-
Book Meetings Books Google Calendar events & fetches weather for the date
72-
Fallback Q&A General questions or how-to help using OCI GenAI
73-
Calculator Extracts & evaluates math from user input
74-
75-
4. Notes
76-
Fully dynamic: user messages are routed in real-time using Cohere model hosted on OCI.
77-
78-
Each tool is modular and can be expanded or replaced.
79-
80-
Streamlit UI shows each step with visual feedback.
81-
82-
5. License
83-
Licensed under the Universal Permissive License (UPL), Version 1.0.
84-
See LICENSE for details.
80+
```
81+
82+
**Streamlit UI**
83+
```bash
84+
streamlit run frontend.py
85+
```
86+
87+
---
88+
89+
## Key Features
90+
91+
| Tool | Description |
92+
|--------------------|-----------------------------------------------------------------------------|
93+
| Fetch Gmail | Retrieves and summarizes unread emails |
94+
| Select Email | Shows full email body |
95+
| OCI AI Agent (RAG) | Answers based on Oracle AI Agent + RAG knowledge base |
96+
| Smart Replies | Drafts professional responses with OCI GenAI |
97+
| Send Email | Sends reply to the original sender |
98+
| Schedule Emails | Delays email sending using background job |
99+
| Weather + Advice | Gives weather report with clothing suggestion |
100+
| Book Meetings | Creates Google Calendar events and checks weather for that date |
101+
| Fallback Q&A | Handles general questions using OCI GenAI |
102+
| Calculator | Parses and evaluates math queries |
103+
104+
---
105+
106+
## ⚠️ Notes
107+
108+
- The assistant dynamically routes user queries using Cohere (hosted on OCI)
109+
- Each tool is modular — easy to extend or replace
110+
- Streamlit UI provides real-time visibility on tool routing
111+
112+
---
113+
114+
### 🔁 Update Email Mappings (Required)
115+
116+
To match received emails to locations (for RAG/OCI agent logic), update:
117+
118+
**At line 397 in the code**:
119+
```python
120+
EMPLOYEE_DATA = {
121+
"example example <example@example.com>": "Netherlands",
122+
"example 2@example.com": "Poland",
123+
"example 3@example.com": "Italy"
124+
}
125+
```
126+
127+
**At line 812 in the code**:
128+
```python
129+
EMPLOYEE_CITY_MAP = {
130+
"example example <example@example.com>": "Netherlands",
131+
"example 2@example.com": "Poland",
132+
"example 3@example.com": "Italy"
133+
}
134+
```
135+
136+
Replace these keys with the **actual email addresses** you'll be receiving messages from.
137+
138+
---
139+
140+
## Useful Links
141+
142+
- [Oracle Generative AI Agents](https://docs.oracle.com/en-us/iaas/Content/generative-ai-agents/overview.htm)
143+
- Overview of OCI's GenAI agent features
144+
- [Oracle Cloud Docs](https://docs.oracle.com/en/cloud/)
145+
- Full documentation for OCI services
146+
- [Weather API](https://www.weatherapi.com/)
147+
- Used for real-time weather data
148+
149+
---
150+
151+
## License
152+
153+
Copyright (c) 2024 Oracle and/or its affiliates.
85154

155+
Licensed under the Universal Permissive License (UPL), Version 1.0.
156+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.

0 commit comments

Comments
 (0)