Roger Gonzalez 451ab831b8
Update Ollama integration for Matrix bot
- Added Ollama client integration to handle chat completions.
- Modified the `chatbot` function to use the Ollama client for chat interactions.
- Removed the `dalle` function as it is not supported by Ollama.
- Updated the `reset_chat` function to handle resetting the chat history with Ollama.
- Added new settings for Ollama base URL and model in `settings.py`.
- Updated documentation in `README.md` to reflect the changes.
2025-03-13 16:10:25 -03:00
2022-08-01 21:52:56 -03:00
2022-08-01 21:52:56 -03:00
2022-08-01 21:55:01 -03:00
2024-11-28 15:21:33 -03:00
2024-11-28 17:26:43 -03:00
2025-03-13 16:06:57 -03:00
2025-03-13 16:06:57 -03:00

Matrix Bot

Matrix Bot

A Matrix bot that helps manage TODOs, track expenses, monitor bank accounts, save links, and interact with AI services - all while storing data in org-mode files.

Features

  • TODO Management: Create and track TODOs with different categories

    • !todo - Regular todos
    • !repeat - Repeating tasks
    • !next - Next actions
    • !waiting - Waiting for items
    • !someday - Future tasks
    • !proj - Project tasks
  • Task Lists: View your daily plan

    • !list free - Personal tasks
    • !list work - Work-related tasks
  • Financial Tracking:

    • !bofa - Check Bank of America account status
  • Link Management:

    • Auto-saves any shared URL to an org-mode file
  • AI Integration:

    • Chat with Llama 3.2 via Ollama (continues conversation)
    • !reset - Reset chat history

Setup

  1. Install dependencies using Poetry:
poetry install
  1. Install and run Ollama:

    • Follow the instructions at Ollama's website to install Ollama
    • Pull the Llama 3.2 model:
    ollama pull llama3.2:latest
    
    • Start the Ollama server (it typically runs on port 11434)
  2. Create a .env file with the following variables:

# Matrix Configuration
MATRIX_URL=
MATRIX_USER=
MATRIX_PASSWORD=
MATRIX_USERNAME=
MATRIX_USERNAMES=

# File Locations
EXPENSES_FILENAME=
ORG_LOCATION=
ORG_CAPTURE_FILENAME=
ORG_PLAN_FILENAME=
ORG_LINKS_FILENAME=

# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2:latest
  1. Run the bot:
python bot.py

Requirements

  • Python 3.9+
  • Poetry for dependency management
  • Matrix server access
  • Optional: Bank accounts with Bank of America for banking features
  • Ollama installed and running with the llama3.2:latest model

Project Structure

  • bot.py: Main bot implementation with command handlers
  • ollama_client.py: Ollama API client for AI features
  • bofa.py: Bank of America data processing
  • org.py: Org-mode file management
  • settings.py: Environment configuration

Dependencies

Key dependencies include:

  • simplematrixbotlib: Matrix bot framework
  • orgparse: Org-mode file parsing
  • requests: API interactions with Ollama
  • pyexcel-ods3: Spreadsheet processing
Description
A Matrix bot for managing TODOs, checking bank balances, tracking expenses, saving links, and chatting with GPT-4 & DALL-E - all while keeping your data in org-mode files 🤖📊
Readme 1.9 MiB
Languages
Python 100%