GithubHelp home page GithubHelp logo

ccurme / ghost Goto Github PK

View Code? Open in Web Editor NEW
45.0 4.0 5.0 200 KB

Create an AI replica of yourself that is accessible via SMS.

License: MIT License

Python 90.09% Makefile 0.88% Jupyter Notebook 8.67% Dockerfile 0.37%

ghost's Introduction

Ghost

Create an AI replica of yourself that is accessible via SMS.

Ghost allows you to chat with (1) a LLM that is fine-tuned on your text messages, or (2) a Langchain agent with a custom prompt that implements retrieval-augmented generation over a set of personal facts. For fine-tuning, Ghost provides functionality to sample and review text conversations from your iPhone, granting oversight of the training data. See fine tuning README for details.

Configuration

Ghost requires two configuration files to tailor your chat responses:

  1. Describe your background, writing style, or mannerisms by modifying prompt_prefix.md, or setting the PROMPT_PREFIX_PATH=/path/to/prompt_prefix.md environment variable.
  2. Provide structured information such as your SMS-enabled Twilio phone number, chatbot name, and aliases in contacts.json. If using the Langchain agent, this configuration file also houses an array of facts that is indexed and retrieved over when generating responses. You can also point to this configuration file by setting the CONTACTS_PATH=/path/to/contacts.json environment variable.

The contacts.json file specifies other important information such as allowed senders for incoming messages, and information about the senders that helps Ghost tailor its responses. See settings/README.md for more detail.

Usage

Ghost currently uses OpenAI LLMs and embeddings, so you will need to provide an API key. You will also need a Twilio account ID, auth token, and SMS-enabled phone number.

Start server:

TWILIO_ACCOUNT_SID=... TWILIO_AUTH_TOKEN=... OPENAI_API_KEY=... URL=... flask run

or build and run using the Dockerfile.

Ghost has four endpoints:

  • /llm_reply: configuring a Twilio SMS webhook to this endpoint will produce replies for inbound messages from known contacts (those in contacts.json).
  • /llm_send: this endpoint will send an unsolicited message to a known contact following a given input prompt (requires authentication).
  • /llm_memory: this endpoint will fetch conversation histories with all contacts (requires authentication).
  • /login: this endpoint can produce a token for use with /llm_send and /llm_memory.

Testing

See Makefile for testing, test coverage and linting.

Unit tests:

make unit_tests

Integration tests:

OPENAI_API_KEY=... make integration_tests

ghost's People

Contributors

ccurme avatar

Stargazers

Till Tomczak avatar 5l1v3r1 avatar  avatar Arkady avatar null data avatar para avatar  avatar Marcus L Endicott avatar Keegan McCallum avatar Alex Spyropoulos avatar Ed Stafford avatar Saul avatar Adam Aziz avatar Owen Walpole avatar Adrien Demarez avatar Greyson Dehn avatar Dmitry Sabanin avatar Dan Reiland avatar Tim Kersey avatar  avatar Simon Holmberg avatar Brandon Smith avatar Paul Asselin avatar François de Mareschal avatar Matin Salehi avatar  avatar René avatar Sheldon Rupp avatar Bora Alp Arat avatar Jérémie Zarca avatar IAbuElRuzz avatar alex avatar Jakub Tomanik avatar Graham Greenfield avatar Sumith Jitta avatar  avatar Matthias Eder avatar  avatar Adam Brusselback avatar eunho avatar Masanori Ogino avatar  avatar Shashi Kumar Nagulakonda avatar Daisy Zhuo avatar  avatar

Watchers

 avatar Kostas Georgiou avatar  avatar  avatar

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.