{"id":22164389,"url":"https://github.com/maciekmalachowski/smartmailer","last_synced_at":"2026-02-11T20:33:09.453Z","repository":{"id":262784600,"uuid":"887994139","full_name":"maciekmalachowski/SmartMailer","owner":"maciekmalachowski","description":"📧AI assistant for email automation, data retrieval, and managing company records with precision and efficiency.","archived":false,"fork":false,"pushed_at":"2024-12-03T18:48:30.000Z","size":1836,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T16:11:51.229Z","etag":null,"topics":["dotenv","excel","gpt4","llama3-1","llamaindex","ollama","openai","pandas","pyyaml","smtplib"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maciekmalachowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-13T16:23:55.000Z","updated_at":"2025-01-17T13:39:41.000Z","dependencies_parsed_at":"2024-11-14T09:29:30.451Z","dependency_job_id":"3f2e0de9-b96a-402e-9893-40a30c545a90","html_url":"https://github.com/maciekmalachowski/SmartMailer","commit_stats":null,"previous_names":["maciekmalachowski/smartmailer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciekmalachowski%2FSmartMailer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciekmalachowski%2FSmartMailer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciekmalachowski%2FSmartMailer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciekmalachowski%2FSmartMailer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maciekmalachowski","download_url":"https://codeload.github.com/maciekmalachowski/SmartMailer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271908,"owners_count":21075800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotenv","excel","gpt4","llama3-1","llamaindex","ollama","openai","pandas","pyyaml","smtplib"],"created_at":"2024-12-02T05:07:20.390Z","updated_at":"2026-02-11T20:33:09.419Z","avatar_url":"https://github.com/maciekmalachowski.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca id=\"readme-top\"\u003e\u003c/a\u003e\n\u003ch1 align=\"center\"\u003e📧SmartMailer\u003c/h1\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\n\u003c/br\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\u003ch2 align=\"center\" id=\"about-the-project\"\u003eAbout The Project\u003c/h2\u003e\n\nThe multi-LLM agent can perform a variety of tasks, including sending personalized emails, querying company data, and managing records such as adding, updating, and deleting company information. It streamlines workflows by leveraging natural language processing to understand and execute tasks with minimal manual intervention.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/demo.gif\"\u003e\u003c/p\u003e\n\nKey Features:\n- **Email Automation:** The agent can send emails to one or more companies based on the email addresses stored in the Excel file. It supports both individual and bulk email sending.\n- **Data Querying:** Users can query the Excel file to retrieve company names, emails, and send status, making data retrieval straightforward and efficient.\n- **Record Management:** The agent allows users to add new company records, update existing email addresses, or delete records entirely based on company names.\n- **Efficient Workflow:** Powered by ``LlamaIndex``, the agent ensures personalized interactions with minimal effort, reducing time spent on repetitive tasks.\n\nBy using this AI-driven system, users can automate email campaigns, track communication status, and manage their company data without manual entry, all from a simple command-line interface.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003ch3 id=\"built-with\"\u003eBuilt With\u003c/h3\u003e\n\n* [![OpenAI]][OpenAI-url] Powers the agent's reasoning and decision-making capabilities using the **GPT-4 Turbo (gpt-4o-mini)** model.\n* [![Ollama]][Ollama-url]  A locally hosted LLM leveraging the **Llama 3.1** model for efficient querying and analysis of the Excel dataset.\n* [![Pandas]][Pandas-url] Facilitates data manipulation and management within the Excel file.\n* [![Smtplib]][Smtplib-url] Handles email sending operations via the SMTP protocol.\n* [![PyYAML]][PyYAML-url] Parses email content stored in markdown file for subject and message configuration.\n* [![dotenv]][dotenv-url] Manages sensitive configuration settings like email credentials via environment variables.\n* [![LlamaIndex]][LlamaIndex-url] Provides a flexible framework for building the AI-driven agent and enabling natural language interaction with tools and data.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n\u003ch2 align=\"center\" id=\"getting-started\"\u003eGetting Started\u003c/h2\u003e\n\n\u003ch3 id=\"prerequisites\"\u003ePrerequisites\u003c/h3\u003e\n\nTo use this project, you need to install **Ollama** and the **Llama 3.1** model locally. Follow the steps below:\n\n1. **Install Ollama Locally:**\n   - Download and install **Ollama** from [Ollama's official website](https://ollama.com/download).\n   \n2. **Install the Llama 3.1 Model:**\n   - After installing Ollama, open a terminal and run the following command to pull the **Llama 3.1** model:\n     ```bash\n     ollama pull llama3.1\n     ```\n\n\u003ch3 id=\"installation\"\u003eInstallation\u003c/h3\u003e\n\nTo set up the project locally, follow these steps:\n\n1. **Clone the Repository:**\n   - Clone this repository to your local machine:\n     ```bash\n     git clone git@github.com:maciekmalachowski/SmartMailer.git\n     cd SmartMailer\n     ```\n\n2. **Create a Virtual Environment:**\n   - Create a virtual environment for the project:\n     ```bash\n     python -m venv ai_venv\n     ```\n   - Activate the virtual environment:\n     - On Windows:\n       ```bash\n       ai_venv\\Scripts\\activate\n       ```\n     - On macOS/Linux:\n       ```bash\n       source ai_venv/bin/activate\n       ```\n\n3. **Install Dependencies:**\n   - Install the required dependencies from `requirements.txt`:\n     ```bash\n     pip install -r requirements.txt\n     ```\n\n4. **Create a `.env` File:**\n   - In the root of the project, create a `.env` file with the following environment variables:\n     ```\n     EMAIL = \"example@gmail.com\"\n     PASSWORD = \"examplepass\"\n     OPENAI_API_KEY = \"exampleCZS5njczXqSBlOfavoO-iHOovT3BlbkFJwcWvyftM7ltRSS8Pkby8zGO4HK4TV8iJf4-fsuuNxayHUkmVPtBuFDUfvPq0czDInnsNWh_eEA\"\n     ```\n    - **Google App Passwords:** If you are using a Google account and have 2-factor authentication enabled, you may need to generate an App Password for this project. You can read more about creating App Passwords [here](https://knowledge.workspace.google.com/kb/how-to-create-app-passwords-000009237).\n      \n   - **Optional (but recommended):** If you have limited space on your main disk, you can specify the location for caching the Ollama models by adding the following variable to the `.env` file:\n     ```\n     OLLAMA_MODELS = \"D:\\Example\\ollama_models\"\n     ```\n     This will redirect Ollama's model cache to the specified location.\n\nOnce these steps are completed, the environment will be ready to run the project!\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\u003ch2 align=\"center\" id=\"usage\"\u003eUsage\u003c/h2\u003e\n\nTo use this AI-driven email agent, follow the steps below:\n\n1. **Activate the Virtual Environment:**\n   \n   - Before running the agent, make sure to activate the virtual environment:\n     - On Windows:\n       ```bash\n       ai_venv\\Scripts\\activate\n       ```\n     - On macOS/Linux:\n       ```bash\n       source ai_venv/bin/activate\n       ```\n\n3. **Run the Agent:**\n   \n   - Once the environment is activated, you can start the agent by running:\n     ```bash\n     python agent.py\n     ```\n   - This will load the agent, and you will be prompted to enter commands.\n\n4. **Example Prompts:**\n   \n   You can interact with the agent by typing different prompts. Here are some examples:\n\n  - **Query the Excel file:**\n     - Retrieve all company names and emails:\n       ```text\n       Retrieve all company names and emails.\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/retrieve.gif\"\u003e\u003c/p\u003e\n   \n   - **Add a new record:**\n     - Add a company with name and email:\n       ```text\n       Add company named example1 with email example@gmail.com.\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/add.gif\"\u003e\u003c/p\u003e\n\n\n   - **Delete a record:**\n     - Delete a company record based on the company name:\n       ```text\n       Delete company named example1.\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/delete.gif\"\u003e\u003c/p\u003e\n\n   - **Update a record:**\n     - Update the email for a specific company:\n       ```text\n       Update email for company named example1 to agent@gmail.com.\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/update.gif\"\u003e\u003c/p\u003e\n\n   - **Send an email:**\n     - Send an email to a company name listed in the Excel file:\n       ```text\n       Send email to company named example1.\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/send.gif\"\u003e\u003c/p\u003e\n\n   - **Check sent emails:**\n     - Query the status of emails that have been sent:\n       ```text\n       Which emails have been sent?\n       ```\n\u003cp align=\"center\"\u003e\u003cimg src=\"media/status.gif\"\u003e\u003c/p\u003e\n\n5. **Excel File Structure:**\n   \n   The Excel file (`company_data.xlsx`) used by the agent contains the following columns:\n   - **Company_name:** The name of the company.\n   - **Company_email:** The email address of the company.\n   - **Send_status:** A field that tracks the status of the email sent to the company (e.g., sent, pending).\n\n6. **Updating Email Title and Subject:**\n   \n   You can easily customize the email's **Subject** and **Message** by updating the `email.md` markdown file.\n   This file contains the following structure:\n   ```markdown\n    ---\n    Subject: \"TEST SUBJECT\"\n    Message: \"TEST MESSAGE\"\n    ---\n   ```\n\n   Simply replace `\"TEST SUBJECT\"` and `\"TEST MESSAGE\"` with the desired email title and content. These changes will be reflected in the emails the agent sends.\n   \nSimply enter the prompts, and the agent will perform the corresponding actions like querying, adding, deleting, updating records, or sending emails.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n\u003ch2 align=\"center\" id=\"license\"\u003eLicense\u003c/h2\u003e\n\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\n[product-screenshot]: images/screenshot.png\n\n[OpenAI]: https://img.shields.io/badge/OpenAI-ffffff?style=for-the-badge\u0026logo=OpenAI\u0026logoColor=black\n[OpenAI-url]: https://openai.com/index/openai-api/\n\n[LlamaIndex]: https://img.shields.io/badge/LlamaIndex-ffffff?style=for-the-badge\u0026logo=llama_index\u0026logoColor=black\n[LlamaIndex-url]: https://www.llamaindex.ai\n\n[Ollama]: https://img.shields.io/badge/Ollama-ffffff?style=for-the-badge\u0026logo=ollama\u0026logoColor=black\n[Ollama-url]: https://ollama.com\n\n[Pandas]: https://img.shields.io/badge/Pandas-ffffff?style=for-the-badge\u0026logo=pandas\u0026logoColor=black\n[Pandas-url]: https://pandas.pydata.org\n\n[Smtplib]: https://img.shields.io/badge/Smtplib-ffffff?style=for-the-badge\u0026logo=gmail\u0026logoColor=black\n[Smtplib-url]: https://docs.python.org/3/library/smtplib.html\n\n[PyYAML]: https://img.shields.io/badge/PyYAML-ffffff?style=for-the-badge\u0026logo=YAML\u0026logoColor=black\n[PyYAML-url]: https://pypi.org/project/PyYAML/\n\n[dotenv]: https://img.shields.io/badge/dotenv-ffffff?style=for-the-badge\u0026logo=dotenv\u0026logoColor=black\n[dotenv-url]: https://pypi.org/project/python-dotenv/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciekmalachowski%2Fsmartmailer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaciekmalachowski%2Fsmartmailer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciekmalachowski%2Fsmartmailer/lists"}