Skip to content

obris-dev/openmagpie

Repository files navigation

OpenMagpie

Open-source, self-hostable listening for the conversations that matter to you, so you can join in while they're active.

License


What it does

You scan Reddit, Hacker News, and a few RSS feeds looking for someone hitting a problem your product solves or asking a question you can answer well. Getting there while the conversation is happening is how you build a brand and a community around what you know. OpenMagpie watches the threads for you so you spend your time on engagement instead of searching.

You curate sources into a feed, write a natural-language description of what's relevant (for example, "someone frustrated with manual social monitoring and asking for alternatives"), and a local LLM scores each new post against it. Matches go to a webhook or your logs (more integrations coming); everything else is dropped. You read the hits instead of the firehose.

Where it listens

OpenMagpie listens wherever communities are having those conversations.

  • Public discussion (today): Reddit, Hacker News, and any RSS or Atom feed (news, blogs, Substack publications, and forums that publish feeds).
  • Communities you're in (roadmap): Slack workspaces and LinkedIn you already belong to, so you catch relevant threads in the groups where you participate, no admin or app install required.

Why self-host it

Social listening is a crowded market (Brand24, Mention, Octolens, Syften, and tools like OutX that pair monitoring with AI-drafted replies). They are all closed SaaS behind a paid plan, a trial, or a sales demo, and the few genuinely free options are basic mention notifiers, not full listening. OpenMagpie is the open, self-hostable exception: run it on your own box with your own model for the cost of the hardware.

  • Open source. Apache 2.0, the whole stack. Read it, fork it, and extend the connectors and engines yourself.
  • Bring your own LLM. Relevance is judged by an LLM you run (Ollama today), so your criteria and your matches never leave your infrastructure.
  • Natural-language matching. You describe what's relevant in natural language and the model scores each new post on meaning.
  • Auditable. Every poll, judgement, and delivery is a row you can inspect (magpie watch action activity / deliveries).

Quick start

Your first real match is a few steps away: clone the repo, point a feed at a subreddit, write a natural-language filter, and run it against live posts.

Prereq: an Ollama instance

OpenMagpie is BYO LLM; the dev stack doesn't bundle one. Point it at an Ollama you control:

  • Local (the default). OLLAMA_URL=http://host.docker.internal:11434 already points at your local Ollama. If you don't have one: brew install ollama (macOS, or see the linux install), then ollama pull qwen2.5:7b and ollama serve.
  • Remote (LAN box, GPU server, cloud). Set OLLAMA_URL=http://your-host:11434 in apps/core/.env.

Set OLLAMA_DEFAULT_MODEL to the model you want to judge with. A 7B model judges in roughly 1 to 3 seconds on Apple Silicon or a recent NVIDIA GPU; CPU-only works but is slower.

Run the stack

git clone git@github.com:obris-dev/openmagpie.git
cd openmagpie
make quickstart      # create .env, build + wait for health, migrate, print next steps

make quickstart is the one-shot path. The equivalent manual steps:

cp apps/core/.env.example apps/core/.env
make build           # build and start Django + the web app
make dev-migrate     # run migrations, create cache table, bootstrap the CLI OAuth app

Then create an account in the browser (visit http://localhost:3001, you'll be signed in), or use the CLI:

make dev-cli-sync                       # uv sync into the workspace .venv
make dev-cli ARGS="auth login"          # opens browser device flow

make dev-cli ARGS="feed create"         # opens $EDITOR on a feed template (sources + retention)
make dev-cli ARGS="watch create"        # opens $EDITOR on a watch template (feeds + action chain)
make dev-tick                           # poll + run the chain once now (vs waiting for the scheduler)

make dev-cli ARGS="watch action activity <action_id>"   # per-state summary (+ --list for the run log)

A watch's actions: chain typically starts with a semantic_filter (your natural-language criteria + threshold) followed by a webhook or log delivery. Pick a backfill window when you create the feed and the first make dev-tick scores real posts against your criteria immediately, with no wait for the scheduler.

Prefer a global magpie? make install-cli puts the dev CLI on your PATH (a snapshot of this checkout; re-run after a git pull to update), then magpie auth login.

Running it continuously

make dev-tick runs one pass by hand. For ongoing operation, start the background scheduler. The four pipeline stages each tick on their own cadence (poll feeds, trigger watches, drain runs, flush digests):

make up-jobs                  # start the tickers (a pid + log per stage under .jobs/)
tail -f .jobs/drain.log       # watch a stage
make down-jobs                # stop them

Each stage is single-flight: a pass that outruns its interval self-skips the next tick, so loops never stack. Production scheduling is then just a plain cron entry per command on the same cadences, with no flock or singleton infrastructure. Override any cadence inline, e.g. make up-jobs DRAIN_INTERVAL=30.

Run make help for the full target list (make up / down, make logs, make dev-test, make dev-check, and so on).

How it works

A Feed is a reusable, curated stream (a set of sources plus an item log). A Watch subscribes to one or more feeds and runs an ordered action chain over each new item: a semantic_filter gates the chain (a score below threshold stops it), and downstream webhook / log actions deliver what passes. One feed can back many watches, so you pay for source polling once.

graph TD
    subgraph Sources
        REDDIT[Reddit]
        RSS[RSS / Atom feeds]
        HN[Hacker News]
        SLACK[Slack]
        LINKEDIN[LinkedIn]
        GITHUB[GitHub]
    end

    subgraph OpenMagpie
        FEED[Feed<br/>curated streams + item log]
        WATCH[Watch<br/>subscribes to feeds]
        FILTER[semantic_filter<br/>action]
        ENGINE[Relevance engine<br/>BYO LLM]
        DELIVER[webhook / log<br/>delivery action]
    end

    subgraph Out
        WEBHOOK[Webhook]
        LOG[Log]
        FUTURE["email / Slack (planned)"]
    end

    REDDIT --> FEED
    RSS --> FEED
    HN -. planned .-> FEED
    SLACK -. planned .-> FEED
    LINKEDIN -. planned .-> FEED
    GITHUB -. planned .-> FEED

    FEED -- "new items" --> WATCH
    WATCH -- "action chain" --> FILTER
    FILTER --> ENGINE
    ENGINE -. "your LLM" .-> LLM["Ollama (today)<br/>Anthropic / OpenAI (planned)"]
    FILTER -- "passes -> next action" --> DELIVER

    DELIVER --> WEBHOOK
    DELIVER --> LOG
    DELIVER -. planned .-> FUTURE
Loading

Delivery is instant (per item) or digest (a window of items batched into one emission). A webhook action POSTs (or PUTs / PATCHes) one self-describing body; instant and digest use the same shape (instant is a one-item batch):

{
  "watch": {"id": "01K...", "name": "ai-webhook"},
  "action_id": "01K...",
  "delivery": "digest",
  "window": {"since": "...", "until": "..."},
  "items": [
    {
      "key": "reddit_subreddit:abc123",
      "source": {"label": "r/ClaudeAI", "kind": "reddit_subreddit"},
      "item": {"title": "...", "url": "..."}
    }
  ]
}

item is the feed item narrowed to the action's include_fields. Each item's key is source:external_id; delivery is at-least-once, so receivers dedup on it. Every call is recorded as a WatchActionDelivery you can inspect:

make dev-cli ARGS="watch action deliveries <webhook_action_id>"   # the list: state / HTTP / host / items / attempt
make dev-cli ARGS="watch action delivery <delivery_id>"           # one call in full, incl. the exact body sent

See AGENTS.md for the design conventions (char pointers, typed-blob pattern, the trigger/drain/flush execution model).

What's shipped today

Layer Shipped
Connectors Reddit (reddit_subreddit), RSS/Atom (rss)
Engines Ollama (ollama)
Action kinds semantic_filter (LLM-judged), webhook, log
Delivery modes instant, digest
Webhook methods POST, PUT, PATCH
Delivery audit per-attempt WatchActionDelivery

Roadmap

  • More connectors: Hacker News, Slack, LinkedIn, GitHub, Bluesky, Mastodon, and X.
  • More engines: Anthropic, OpenAI, and a keyword engine behind the same Engine Protocol.
  • Learns from feedback: thumbs up/down on past matches become few-shot examples for the next pass.
  • Run-history in the payload: the upstream filter score and chain provenance as an opt-in webhook field.
  • Branching and parallel chains: the data model already carries WatchPath and dense action ranks; multi-path and DAG branching are post-v1.
  • Retention: pruning for WatchActionRun and WatchActionDelivery history.

Hosted version

Self-hosting is free and stays free. A managed hosted version (no infrastructure to run) is in the works as the paid tier.

Join the waitlist at openmagpie.ai.

Project structure

uv workspace; one root uv.lock for everything Python.

apps/
  core/                       Django backend (deployable)
    common/                   BaseModel (ULID PK + timestamps), ULIDField, locks, db ceilings, /healthz
    accounts/                 User / Account / UserProfile + services + AccountScopedAPIView mixin
    auth_api/                 signup / login / logout / me + tokens/* + device-flow handshake (DRF)
    sources/                  Connectors (Reddit subreddit, RSS/Atom) + SourcePayload classes + registry
    feeds/                    Feed + Source + FeedItem models + poll orchestrator + item log
    engine/                   Engine Protocol + OllamaEngine package + registry
    watches/                  Watch + WatchFeed + WatchPath + WatchAction + WatchActionRun + WatchActionDelivery
    conf/                     settings (base/local), urls, wsgi
  cli/                        magpie CLI (Typer + httpx + Pydantic); distributed as a standalone wheel
packages/
  openmagpie-schema/          Pure Pydantic models shared by core + cli (configs, wire types, feed shapes)
web/                          pnpm workspace: apps/{app,marketing,email-render} (Next.js) + packages/{ui,api-utils,auth,tailwind-config}
make/                         Per-concern Makefile targets
scripts/                      Helper scripts (whitespace check, make-help)

Documentation

License

OpenMagpie is open source under the Apache License 2.0, with optional enterprise directories (**/ee/) reserved for future commercial features.

About

Open-source, self-hostable social listening tool that surfaces the conversations that matter to you, so you can join in while they're active.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors