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.6.2) - 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, Domain, DomainEvent, EventGraph


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))

External @on(...) handlers compose in the same graph — use them for invariants, declared exceptions, or reactions across domains. 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.6.2.tar.gz (342.0 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.6.2-py3-none-any.whl (83.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langgraph_events-0.6.2.tar.gz
  • Upload date:
  • Size: 342.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.6.2.tar.gz
Algorithm Hash digest
SHA256 e2f97375400911084167416b4a78f589eaf9b0414ad4fb5b5f74c5611864ab7b
MD5 665d9b1213fb8fdbc38d97cbbfb08d7e
BLAKE2b-256 082841122f12fed8febb9562d005f2087e6b952d9ae643b2ad025414501650df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: langgraph_events-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 83.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d66cc99a9f42a937736e3e01d9805d872ce44d6104558f97cd3995548abb68db
MD5 7bee03cc80cc102cb0c1dd7343e447a1
BLAKE2b-256 2b57cb4113f3d10217ea2f01dd6073a0a3710c585415424855e7c7feca71d3ac

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