- 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.
2.3 KiB
2.3 KiB
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
- Install dependencies using Poetry:
poetry install
-
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)
-
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
- 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 handlersollama_client.py
: Ollama API client for AI featuresbofa.py
: Bank of America data processingorg.py
: Org-mode file managementsettings.py
: Environment configuration
Dependencies
Key dependencies include:
simplematrixbotlib
: Matrix bot frameworkorgparse
: Org-mode file parsingrequests
: API interactions with Ollamapyexcel-ods3
: Spreadsheet processing