Metadata-Version: 2.4
Name: langgraph-events
Version: 0.6.1
Summary: Opinionated event-driven abstraction for LangGraph. State IS events.
Project-URL: Homepage, https://cadance-io.github.io/langgraph-events/
Project-URL: Repository, https://github.com/cadance-io/langgraph-events
Project-URL: Documentation, https://cadance-io.github.io/langgraph-events/
Project-URL: Changelog, https://github.com/cadance-io/langgraph-events/blob/main/CHANGELOG.md
Author: cadance-io
License-Expression: MIT
License-File: LICENSE
Keywords: event-driven,events,langgraph,state-machine
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: langgraph>=0.2.0
Provides-Extra: agui
Requires-Dist: ag-ui-protocol>=0.1.0; extra == 'agui'
Description-Content-Type: text/markdown

# langgraph-events

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

> [!CAUTION]
> **Experimental (v0.6.1)** - 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.

```python
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](docs/concepts.md) and [Control Flow](docs/control-flow.md).

## Installation

```bash
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

- Docs site (GitHub Pages): <https://cadance-io.github.io/langgraph-events/>
- Local docs index: [`docs/index.md`](docs/index.md)
- Getting started: [`docs/getting-started.md`](docs/getting-started.md)
- Core concepts: [`docs/concepts.md`](docs/concepts.md)
- Patterns: [`docs/patterns.md`](docs/patterns.md)
- API reference: [`docs/api.md`](docs/api.md)
- AG-UI adapter: [`docs/agui.md`](docs/agui.md)
- Checkpointer and graph evolution: [`docs/checkpointer-evolution.md`](docs/checkpointer-evolution.md)

## Development

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

## License

MIT - see [`LICENSE`](LICENSE).
