Skip to main content

Opinionated event-driven abstraction for LangGraph. State IS events.

Project description

langgraph-events

Opinionated event-driven abstraction for LangGraph. State IS events.

[!CAUTION] Experimental (v0.14.0) - This is an early-stage personal project, not a supported product. The API will change without notice or migration path.

Quick Start

Group related commands and events into a Namespace; colocate the handler on the command.

from langgraph_events import Command, DomainEvent, EventGraph, Namespace


class Order(Namespace):
    class Place(Command):
        customer_id: str

        class Placed(DomainEvent):
            order_id: str

        def handle(self) -> Placed:
            return Order.Place.Placed(order_id=f"o-{self.customer_id}")


graph = EventGraph([Order.Place])
log = graph.invoke(Order.Place(customer_id="alice"))
print(log.latest(Order.Place.Placed))

@on(...) handlers add invariants, declared exceptions, and cross-namespace reactions. See Concepts and Control Flow.

Installation

pip install langgraph-events

# With AG-UI adapter support
pip install "langgraph-events[agui]"

# From source (development)
pip install git+https://github.com/cadance-io/langgraph-events.git

Documentation

Development

uv sync --group dev
uv run pytest tests/
uv run ruff check src/ tests/
uv run mypy src/

License

MIT - see LICENSE.

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

langgraph_events-0.14.0.tar.gz (432.7 kB view details)

Uploaded Source

Built Distribution

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

langgraph_events-0.14.0-py3-none-any.whl (118.7 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_events-0.14.0.tar.gz.

File metadata

  • Download URL: langgraph_events-0.14.0.tar.gz
  • Upload date:
  • Size: 432.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for langgraph_events-0.14.0.tar.gz
Algorithm Hash digest
SHA256 14c4457039874bed1d55c74aa56aa32788909aca89d3d7ca1f0df6e2f38250ad
MD5 695f9b3570d4ac05ab252ef95d1c1f91
BLAKE2b-256 c44f6fcc1a47821d4c59693c23989f78614670bd7294249f58b403acb4fa5b48

See more details on using hashes here.

File details

Details for the file langgraph_events-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: langgraph_events-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 118.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for langgraph_events-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94fc7f079d9879b7d2abc9cf7ef493273ac3e7f188b3c42085f341345b8c959a
MD5 6043f595d60bf136a532f5e157d6d50c
BLAKE2b-256 fe85960d128d9f9fef3494448f23f22d475143c27afb2970b86c376a594d6c31

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