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.2.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.2-py3-none-any.whl (98.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loomr-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 857bab0ec548c2bab8ec79bdcc4371c0feba8e91a02ea7f1ec3e80d1fd7839f9
MD5 71a94f27ab6b1df17cf3366e8ca540f8
BLAKE2b-256 b885c32e2d4e8c4c6ed4e8504282a3779576dc5a16d45b3d6b63447d69869234

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loomr-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6fefd5cefa4783e01038cbf5f544160fa307b347f4886d2dcde2f4545ba5b55
MD5 d3e085a9df3fd370276aa43fa2e18fcb
BLAKE2b-256 815bf89498b94c7f85f4b72423e0a2f1ea0814daab217d08f785f6d9b520ef74

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