ULMEN extension for LangGraph — compressed checkpoints, token-efficient context, binary streaming
Project description
ulmen-langgraph
ULMEN extension for LangGraph. Drop-in ULMEN-compressed replacements for LangGraph's checkpointer, store, stream, and subgraph handoff surfaces.
Install
pip install ulmen-langgraph
What it does
| Surface | Today (LangGraph) | With ulmen-langgraph |
|---|---|---|
| Checkpoint storage | json.dumps per step | ULMEN binary + zlib |
| LLM context | Raw JSON message list | ULMEN LLM surface (~44% fewer tokens) |
| graph.stream() egress | JSON blob per event | ULMEN binary per chunk |
| Subgraph handoff | JSON state at boundary | ULMEN binary blob |
| Long-term store | Raw dict values | ULMEN binary + zlib |
Quick Start
from langgraph.checkpoint.memory import MemorySaver
from langgraph.store.memory import InMemoryStore
from ulmen.ext.langgraph import (
UlmenCheckpointer,
ulmen_context_reducer,
UlmenStreamSink,
UlmenStore,
encode_handoff,
decode_handoff,
ulmen_send,
make_ulmen_state,
UlmenExtInfo,
)
# Introspection
print(UlmenExtInfo())
# 1. Checkpointer: wrap any existing saver, zero graph changes
saver = UlmenCheckpointer(MemorySaver())
graph = builder.compile(checkpointer=saver)
# 2. Context reducer: compress message history automatically
from typing import Annotated, TypedDict
class State(TypedDict):
messages: Annotated[list, ulmen_context_reducer]
# Or use the helper
AgentState = make_ulmen_state(
extra_fields={"session_id": str},
context_window=8000,
)
# 3. Stream sink: binary egress instead of JSON
for chunk in UlmenStreamSink(graph.stream(input, config)):
redis.publish("events", chunk) # bytes, not JSON
# Async
async for chunk in UlmenAsyncStreamSink(graph.astream(input, config)):
await redis.publish("events", chunk)
# 4. Store: compress long-term memory values
store = UlmenStore(InMemoryStore())
store.put(("user", "alice"), "prefs", {"theme": "dark"})
item = store.get(("user", "alice"), "prefs")
# 5. Subgraph handoff
blob = encode_handoff(state) # bytes
state = decode_handoff(blob) # back to dict
# ULMEN-aware Send
return [ulmen_send("child_agent", state)]
Works with any backend
# MemorySaver
UlmenCheckpointer(MemorySaver())
# SqliteSaver
from langgraph.checkpoint.sqlite import SqliteSaver
UlmenCheckpointer(SqliteSaver.from_conn_string("state.db"))
# PostgresSaver
from langgraph.checkpoint.postgres import PostgresSaver
UlmenCheckpointer(PostgresSaver.from_conn_string(DB_URI))
License BSL 1.1: free for entities under $10M annual revenue. See [LICENSE] for full terms.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ulmen_langgraph-0.1.0.tar.gz.
File metadata
- Download URL: ulmen_langgraph-0.1.0.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a166dfa1539b577031c08f3b243d0e2ac747855fd01b90376bb666f13759bf5c
|
|
| MD5 |
d2dcf51210f53baf148035cfcb156649
|
|
| BLAKE2b-256 |
d4ce6e6c3a9cd9f7dfeb4b2753515131f7a2f22f4da19dc912f82ad37ee6894f
|
Provenance
The following attestation bundles were made for ulmen_langgraph-0.1.0.tar.gz:
Publisher:
ext-langgraph-publish.yml on makroumi/ulmen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ulmen_langgraph-0.1.0.tar.gz -
Subject digest:
a166dfa1539b577031c08f3b243d0e2ac747855fd01b90376bb666f13759bf5c - Sigstore transparency entry: 1321480589
- Sigstore integration time:
-
Permalink:
makroumi/ulmen@871e124189ce6612a238b112b88a51a089c13e95 -
Branch / Tag:
refs/tags/ext-v0.1.1 - Owner: https://github.com/makroumi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ext-langgraph-publish.yml@871e124189ce6612a238b112b88a51a089c13e95 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ulmen_langgraph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ulmen_langgraph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f99c161fde2080579c43bc14d4c4b9b8fe89869a9fe395ded6342d2f0103a60e
|
|
| MD5 |
fbac2d15c84ea387fe0dd8b6688fdc01
|
|
| BLAKE2b-256 |
21c189d653d79290d0886e7f1f9dd44788a87047c603228e795e5143f4d33829
|
Provenance
The following attestation bundles were made for ulmen_langgraph-0.1.0-py3-none-any.whl:
Publisher:
ext-langgraph-publish.yml on makroumi/ulmen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ulmen_langgraph-0.1.0-py3-none-any.whl -
Subject digest:
f99c161fde2080579c43bc14d4c4b9b8fe89869a9fe395ded6342d2f0103a60e - Sigstore transparency entry: 1321480676
- Sigstore integration time:
-
Permalink:
makroumi/ulmen@871e124189ce6612a238b112b88a51a089c13e95 -
Branch / Tag:
refs/tags/ext-v0.1.1 - Owner: https://github.com/makroumi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ext-langgraph-publish.yml@871e124189ce6612a238b112b88a51a089c13e95 -
Trigger Event:
push
-
Statement type: