Files
botbot/README.md
2025-05-01 11:59:41 +01:00

110 lines
2.8 KiB
Markdown

# Botbot
*Botbot, your not so friendly Bot*
A Matrix chat bot that listens to specified rooms, records conversations, leverages OpenAI for AI-driven summaries, and assists with answering questions.
## Objectives
- Record message history on rooms its participating.
- Create discussion summaries to capture actionable items, deadlines, and decisions on subjects discussed on those rooms.
- Use collected knoledge to answer questions placed by participants in discussions that are left unansewerd after some time, and also when its direclty addressed using it's @handle
also,
- Support additional AI backends beyond OpenAI (e.g., local LLMs, alternative APIs).
- Possibly support other Chat services beyownd Matrix like Telegram, Teams or Whatsapp.
## Current Features
- **Auto-join Rooms**: Automatically joins rooms when invited.
- **Message Callbacks**: Responds to basic commands:
- `!ping``Pong!`
- `hello botbot` → Greeting
## Prerequisites
- Docker & Docker Compose (or Python 3.8+)
- A Matrix account for the bot
- OpenAI API key
## Installation
1. **Clone the repository**
```bash
git clone https://gitea.alluna.pt/jfig/botbot.git
cd botbot
```
2. **Configure environment variables**
Copy the example file and edit it:
```bash
cp .env.example .env
```
Then open `.env` and set:
```ini
LOG_LEVEL=INFO
HOMESERVER_URL=https://matrix.org
USER_ID=@botbot_user:matrix.org
PASSWORD=your_matrix_password
OPENAI_API_KEY=your_openai_api_key
```
## Usage
### Using Docker Compose (development/hot-reload)
```bash
docker-compose up --build
```
### Building and Running Manually (production)
```bash
# Build container
docker build -t botbot .
# Run container
docker run -d --env-file .env \
-v matrix_data:/app/data \
--restart unless-stopped \
botbot
```
## Configuration Options
- `LOG_LEVEL`: One of `CRITICAL`, `ERROR`, `WARNING`, `INFO`, `DEBUG`, `NOTSET`.
- `HOMESERVER_URL`: Matrix homeserver endpoint (e.g., `https://matrix.org`).
- `USER_ID`: Bot's full Matrix user ID (e.g., `@botbot_user:matrix.org`).
- `PASSWORD`: Password for the bot account.
- `OPENAI_API_KEY`: API key for OpenAI usage.
## How It Works
1. **Startup**: Loads environment and logs into the Matrix homeserver.
2. **Callbacks**:
- `message_callback`: Handles text messages and triggers AI logic.
- `invite_cb`: Joins rooms on invitation.
3. **AI Integration**: Future development will:
- Pull recent chat history.
- Call OpenAI endpoints to generate summaries or answers.
## Contributing
1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/xyz`).
3. Commit changes and push (`git push origin feature/xyz`).
4. Open a pull request with a description of your changes.
## License
This project is licensed under the [MIT License](LICENSE).