This project implements a modular Personal Assistant System capable of handling a variety of tasks such as email management, meeting scheduling, PDF document parsing, and web search functionality.
- Python 3.x
- Required Libraries:
PyPDF2,jproperties,requests, and others listed inrequirements.txt.
- Clone the repository:
git clone https://github.com/your-username/personal-assistant-system.git
- Install dependencies:
pip install -r requirements.txt
- Set up API credentials for Gmail, Google Calendar, Brave API, and the language model.
- Run the main script with appropriate commands:
python main.py "Schedule a meeting with John on Monday at 2 PM"
The system consists of:
- A Main Script that serves as the entry point, routing user inputs to the appropriate services.
- Service Modules that handle domain-specific tasks like email and calendar management, PDF processing, and web search.
- A Language Model Integration to process natural language queries and classify commands.
-
Main Script (
main()):- Entry point for the application.
- Parses command-line inputs to determine the appropriate service to execute.
-
LLMService:
- Connects to an external language model (e.g.,
llama3-8b-8192). - Interprets and classifies user inputs.
- Provides utilities for identifying whether a query involves personal or public data.
- Connects to an external language model (e.g.,
-
GSuiteService:
- A subclass of
LLMServicefor handling email and calendar-related tasks. - Integrates with Gmail API for:
- Sending, replying to, and reading emails.
- Utilizes Google Calendar API for:
- Scheduling meetings, parsing attendee information, and creating events.
- Includes logic to determine if emails require responses.
- A subclass of
-
PdfService:
- Extracts text from PDF documents using
PyPDF2. - Processes text with the language model for:
- Summarizing content.
- Answering user queries based on document information.
- Extracts text from PDF documents using
-
SearchService:
- Performs web searches using the Brave API.
- Retrieves and summarizes results efficiently with multithreading.
-
Groq Client:
- Integrated within
LLMServicefor interacting with the external language model API. - Generates:
- Email subjects and body text.
- Meeting scheduling prompts.
- Integrated within
-
Configuration Management:
- Uses the
jpropertieslibrary to store and retrieve settings like model URLs and API keys.
- Uses the
-
Authentication:
- GSuiteService uses OAuth 2.0 for authenticating with Google APIs.
- Credentials are managed using
token.jsonorclient_secret.json.
- The task indentification is driven by the local LLM
- Example: Commands with "message or implying message" activate
GSuiteService, while "PDF or document" invokesPdfService.
- Example: Commands with "message or implying message" activate
- Automates sending and replying to emails.
- Generates context-aware email content using the language model.
- Extracts details such as date, time, and attendees from commands.
- Creates Google Calendar events with Google Meet links.
- Extracts and analyzes text from PDFs.
- Provides document summaries and answers queries based on the content.
- Conducts web queries via the Brave API.
- Retrieves, processes, and summarizes search results efficiently using multithreading.