Skip to main content

Modular, event-driven messaging bot runtime with plugins, YAML flows, and built-in FastAPI.

Project description

Loomr — Modular Messaging Service

PyPI version npm version Loomr is a modular, event-driven messaging runtime for building bots and automations across channels. Start with Telegram today; add more platforms via adapters and plugins. Configure flows in YAML, integrate via HTTP or SDKs, and run anywhere (Docker, CLI, or code).

Why Loomr

  • Multi-channel by design: Start with Telegram; add more via adapters.
  • Modular: Drop-in plugins for features (admin tools, analytics, menus, products, support, ticker, etc.).
  • Flows in YAML: Describe steps, prompts, validations, branches without code.
  • Event-driven: Built-in bus to trigger HTTP or shell actions on events (payments, roles, deliveries).
  • First-class API: FastAPI server with OpenAPI/Swagger for delivery and integrations.
  • Ship fast: Use Docker one-liners or the CLI, customize when needed.

Quickstart

Docker

  • Docker (API):

    docker build -t loomr/messaging .
    docker run --rm -p 8090:8090 -e MODE=api loomr/messaging
    # Open http://127.0.0.1:8090/docs
    
  • Docker (Bot):

    docker run --rm --env-file messaging_service/.env -e MODE=bot loomr/messaging
    
  • CLI (local):

    python3 -m venv messaging_service/.venv
    messaging_service/.venv/bin/pip install -r messaging_service/requirements.txt
    messaging_service/.venv/bin/python -m messaging_service.cli init
    messaging_service/.venv/bin/python -m messaging_service.cli run-api
    # or
    messaging_service/.venv/bin/python -m messaging_service.cli run-bot
    

Local LLM via Ollama (optional)

Run Loomr with a local model through Ollama. The built-in plugin ollama_assistant exposes two commands:

  • /ask <question> — ask the local model a question.
  • /coach <user reply> — evaluate if a user's reply answers the current question and get a clearer re-ask.

Setup

  1. Install and pull a model
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3:8b
curl -sS http://127.0.0.1:11434/api/tags
  1. Environment

Copy .env.example to .env and set at least your Telegram token. Optional Ollama vars:

OLLAMA_HOST=http://127.0.0.1:11434
OLLAMA_MODEL=llama3:8b
QUESTIONARY_PATH=messaging_service/config/questionary.md
  1. Enable plugin

messaging_service/config/config.yaml already includes ollama_assistant under plugins.enabled and an ollama: section.

  1. Run
make venv && make install
make run-bot

Usage examples

DM or Group (with BotFather privacy ON, the bot only sees commands):

/ask What plugins are enabled?
/ask Summarize the last 5 messages.
/coach Why should I choice ?

Group privacy OFF allows the bot to receive normal messages, but by default this plugin only responds to /ask and /coach.

API overview

FastAPI app in messaging_service/api_server.py.

  • Docs: GET /docs, GET /redoc
  • Product delivery: POST /deliver
  • TON verify (example): POST /ton/verify
  • Group upgrade (example): POST /group/upgrade

Auth: set DELIVER_BEARER in .env and include Authorization: Bearer <token> for /deliver.

TypeScript SDK (npm)

A minimal SDK is provided in clients/ts-sdk and published as loomr-sdk.

Install:

npm i loomr-sdk

Usage:

import { LoomrClient } from 'loomr-sdk';

const client = new LoomrClient({ baseUrl: 'http://127.0.0.1:8090', token: 'Bearer ...' });
const health = await client.health();

CI publishes on tags named sdk-v* (see .github/workflows/npm-publish.yml).

Roadmap

  • Additional adapters (WhatsApp/Instagram/etc.)
  • SDKs from OpenAPI (TypeScript + Python)
  • More built-in plugins and flow blocks
  • Docker image publish on tags (GHCR/Docker Hub)

License

Source-available and free for non‑commercial use under the Prosperity Public License 3.0.0.

  • See: LICENSE (Prosperity-3.0.0)
  • Commercial licensing: COMMERCIAL_LICENSE.md
  • Third‑party notices: THIRD-PARTY-NOTICES.md

Contributing

See CONTRIBUTING.md. PRs and plugins welcome!

Community & Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loomr-0.1.6.tar.gz (82.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loomr-0.1.6-py3-none-any.whl (98.7 kB view details)

Uploaded Python 3

File details

Details for the file loomr-0.1.6.tar.gz.

File metadata

  • Download URL: loomr-0.1.6.tar.gz
  • Upload date:
  • Size: 82.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for loomr-0.1.6.tar.gz
Algorithm Hash digest
SHA256 1fe6ded6686300c5642a2409ed9f488d0db1605b2e1289cabaee2f0fe4628385
MD5 f1be61716711db202017340e0c3bbf95
BLAKE2b-256 85bb614f919ba7c2d9312e37e85e33558e68b05c586c5864d977cd1c6fd65dd7

See more details on using hashes here.

File details

Details for the file loomr-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: loomr-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 98.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for loomr-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c63ee55993d4bbaa8d2b2a53fdbcd3245b54d967e5ef6caeffc4f2c57c8cc0f2
MD5 be22b0cd28ed4931927d3ecef511c957
BLAKE2b-256 2a66248dfe07523a44995ad54a548d74b8af380479fa07f113f1c397ec7adfb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page