This project introduce a bot that can help Whatsapp communities (using groups) to enrich their experience by using LLM models.
The project is composed by two main components:
- A
chat-manager
that is responsible for connecting to Whatsapp, and interacting with it. This component is written in Go and exposes a gRPC API over a Unix Domain Socket. - The
bot
which is a python application that connects to thechat-manager
and uses it to interact with Whatsapp. This component is written in Python and uses thechat-manager
to interact with Whatsapp. It is using LangChain and OpenAI.
- Docker
- Copy the
.env.edit
file to.env
and edit it to your needs.- You must define the
OPENAI_API_KEY
variable with your own key - If you wish to use the pre-configured postgres database, there's no need to define it's variable.
- You must define the
docker compose up -d
- The first time you connect, the
chat-manager
container will show you a QR code. Scan it with your Whatsapp mobile application. - Add your bot to the group you wish to use it in (using the mobile app, or another Whatsapp web).
- After the bot is running(both
chat-manager
andbot
containers with no errors), and after the bot got a few messages in some groups, you'll be able to see those groups in the database under thegroups
table. - To allow the bot to interact with the group, you need to set the
managed
column totrue
for the group you wish to use the bot in.