Skip to main content

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

Project description

Loomr — Modular Messaging Service

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.

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.3.tar.gz (81.8 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.3-py3-none-any.whl (98.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loomr-0.1.3.tar.gz
  • Upload date:
  • Size: 81.8 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.3.tar.gz
Algorithm Hash digest
SHA256 45f396b341954bea79210d1743fe6484402a582d1850210a274fa086afeae31d
MD5 b736d810464dd909bd4569c15b34c554
BLAKE2b-256 508015d3010af092df4308c300650be3740f717aab4d8324a0e92edf9b43df5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loomr-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 98.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6038b5deb9bb98e845d6c169bf13a2e9143e9261b48c9f105062e157dfd8185a
MD5 c8461dade0cc529f93cc9fe6087b6977
BLAKE2b-256 ed0e6325b2c5a59ae00c4d5de7079b9b994efa1e58e0aa5eaca32801d2649598

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