Metadata-Version: 2.5
Name: langgraph-events
Version: 0.47.2
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: beartype>=0.22.0
Requires-Dist: langgraph-checkpoint>=4.0.3
Requires-Dist: langgraph>=0.2.0
Provides-Extra: agui
Requires-Dist: ag-ui-protocol>=1.0.0; extra == 'agui'
Requires-Dist: langchain-core>=1.0.0; extra == 'agui'
Provides-Extra: postgres
Requires-Dist: langgraph-checkpoint-postgres<4,>=3.1.2; extra == 'postgres'
Requires-Dist: psycopg<4,>=3.2.0; extra == 'postgres'
Provides-Extra: sqlite
Requires-Dist: langgraph-checkpoint-sqlite<4,>=3.1.1; extra == 'sqlite'
Description-Content-Type: text/markdown

# langgraph-events

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

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

```python
from __future__ import annotations

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

## Installation

Requires Python 3.11+.

```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: <https://cadance-io.github.io/langgraph-events/>
- [Getting Started](docs/getting-started.md)
- [Core Concepts](docs/concepts.md)
- [API Reference](docs/api.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).
