feat: LLM Bot (chatbot) with Ollama support #74

Open
opened 2026-04-26 16:46:28 +00:00 by icub3d · 0 comments
Owner

Migrated from GitHub issue icub3d/decentcom#115
Original Author: @icub3d
Original Date: 2026-04-24T00:09:01Z


Feature: LLM Bot (chatbot)

Overview

Implement a reference LLM-powered bot that responds to mentions in channels. The bot will use a pluggable provider system, with the initial implementation focusing on Ollama for local execution.

Background

Reference bots (welcomebot, modbot, auditbot) provide utility and examples for the SDK. An LLM bot demonstrates how to build interactive, stateful (or stateless) bots that can assist users, answer questions, or provide entertainment.

Requirements

  • decentcom-chatbot: responds to @mention in any channel it has access to.
  • Pluggable LLM provider architecture (starting with Ollama).
  • Configurable via TOML: Ollama URL, model name, system prompt, temperature, etc.
  • Strips the bot's own mention from the prompt before sending to the LLM.
  • README explaining setup and Ollama configuration.

Design

Component Changes

  • New workspace member: tools/bots/chatbot/.
  • Uses existing decentcom-bot SDK.
  • Integrates with Ollama REST API.

Task List

Phase 1: Infrastructure

  • Scaffold tools/bots/chatbot/ crate.
  • Define TOML config with provider-specific settings.
  • Implement mention detection helper.

Phase 2: Ollama Integration

  • Implement Ollama client (using reqwest).
  • Handle streaming or non-streaming responses from Ollama.
  • Implement on_message handler to trigger LLM response.

Phase 3: Documentation

  • Add README with installation and configuration guide.
  • Add example chatbot.toml.

Test List

  • Unit test: Mention detection and content stripping.
  • Unit test: TOML configuration parsing.
  • Integration test: Mock Ollama response handling.

Open Questions

  • Should we maintain conversation history? (Recommendation: start with stateless per-message response for MVP).
  • How should we handle long responses that exceed message limits? (Recommendation: truncate or split, though decentcom limits are generous).
**Migrated from GitHub issue icub3d/decentcom#115** **Original Author:** @icub3d **Original Date:** 2026-04-24T00:09:01Z --- # Feature: LLM Bot (chatbot) ## Overview Implement a reference LLM-powered bot that responds to mentions in channels. The bot will use a pluggable provider system, with the initial implementation focusing on [Ollama](https://ollama.com/) for local execution. ## Background Reference bots (welcomebot, modbot, auditbot) provide utility and examples for the SDK. An LLM bot demonstrates how to build interactive, stateful (or stateless) bots that can assist users, answer questions, or provide entertainment. ## Requirements - [x] `decentcom-chatbot`: responds to `@mention` in any channel it has access to. - [x] Pluggable LLM provider architecture (starting with Ollama). - [x] Configurable via TOML: Ollama URL, model name, system prompt, temperature, etc. - [x] Strips the bot's own mention from the prompt before sending to the LLM. - [x] README explaining setup and Ollama configuration. ## Design ### Component Changes - New workspace member: `tools/bots/chatbot/`. - Uses existing `decentcom-bot` SDK. - Integrates with Ollama REST API. ## Task List ### Phase 1: Infrastructure - [x] Scaffold `tools/bots/chatbot/` crate. - [x] Define TOML config with provider-specific settings. - [x] Implement mention detection helper. ### Phase 2: Ollama Integration - [x] Implement Ollama client (using `reqwest`). - [x] Handle streaming or non-streaming responses from Ollama. - [x] Implement `on_message` handler to trigger LLM response. ### Phase 3: Documentation - [x] Add README with installation and configuration guide. - [x] Add example `chatbot.toml`. ## Test List - [x] Unit test: Mention detection and content stripping. - [x] Unit test: TOML configuration parsing. - [x] Integration test: Mock Ollama response handling. ## Open Questions - Should we maintain conversation history? (Recommendation: start with stateless per-message response for MVP). - How should we handle long responses that exceed message limits? (Recommendation: truncate or split, though `decentcom` limits are generous).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#74
No description provided.