Giter Site home page Giter Site logo

tznurmin / robofriend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 23 KB

RoboFriend is an AI-powered penpal application using OpenAI's GPT and Docker. Engage in meaningful email exchanges, automatically receive personalized responses, and enjoy seamless email management with a persistent MongoDB-backed conversation history.

License: MIT License

Python 99.03% Shell 0.97%
ai chatbot conversation docker docker-compose email email-automation gpt gpt4-api mongodb natural-language-processing nlp openai penpal python

robofriend's Introduction

RoboFriend

RoboFriend is a Dockerized AI-powered penpal application. It uses an AI model to generate engaging email responses and a mailer service to send and receive emails. The application is composed of three main services:

  1. AI Service: Uses an AI model to generate email responses and summarize discussions.
  2. Mailer Service: Sends and receives emails, managing the communication with your penpal.
  3. MongoDB service: Stores the email exchanges and current summary between RoboFriend and the user.

Project Structure

Here's an overview of the project structure:

docker
├── df
│   ├── Dockerfile.ai              # Dockerfile for the AI service
│   ├── Dockerfile.mailer          # Dockerfile for the mailer service
│   ├── ai_data
│   │   ├── ai_penpal.py           # AI penpal logic
│   │   ├── discussion_summary.py  # Discussion summarization logic
│   │   ├── maildb.py              # Database interaction module for AI service
│   │   ├── openai.key             # API key for OpenAI GPT model
│   │   └── requirements.txt       # Python dependencies for the AI service
│   └── mailer_data
│       ├── maildb.py              # Database interaction module for mailer service
│       ├── penpal_mailer.py       # Email sending and receiving logic
│       ├── requirements.txt       # Python dependencies for the mailer service
│       └── token.json             # OAuth2 token for Google API
├── docker-compose.yaml            # Docker Compose configuration file
└── init-mongo.sh                  # Initialization script for MongoDB

Requirements

  • Docker
  • Docker Compose
  • A Google API OAuth2 token for accessing Gmail (follow these instructions to obtain a token)
  • An OpenAI API key for using the GPT model (sign up on OpenAI's platform to get an API key)

Setup

  1. Clone this repository:

    git clone https://github.com/tznurmin/robofriend.git
    cd robofriend/docker
    
  2. Add your OpenAI API key to df/ai_data/openai.key.

  3. Add your Google API OAuth2 token to df/mailer_data/token.json.

  4. Edit the docker-compose.yaml file to configure the project details.

  5. Build and run the application using Docker Compose:

    docker-compose up -d
    
  6. Your RoboFriend is now up and running! The AI service will start generating email responses and the mailer service will send and receive emails.

Usage

Once the application is running, simply send an email to the configured email address. In the email address's local part (the part before the '@' symbol), include a plus sign (+) followed by a user ID to uniquely identify the user. This helps the AI service differentiate between different users and maintain separate conversation histories for each user. The AI service will generate a response based on the summary stored in the MongoDB service, and the mailer service will send the email to the recipient.

For example, if your configured email address is [email protected] and the user ID is john123, the email should be sent to [email protected].

Stopping the Application

To stop the running containers and remove the associated resources, execute the following command in the project directory:

docker-compose down

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.