Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ulmen_langgraph-0.1.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

ulmen_langgraph-0.1.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

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

Hashes for ulmen_langgraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a166dfa1539b577031c08f3b243d0e2ac747855fd01b90376bb666f13759bf5c
MD5 d2dcf51210f53baf148035cfcb156649
BLAKE2b-256 d4ce6e6c3a9cd9f7dfeb4b2753515131f7a2f22f4da19dc912f82ad37ee6894f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ulmen_langgraph-0.1.0.tar.gz:

Publisher: ext-langgraph-publish.yml on makroumi/ulmen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ulmen_langgraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f99c161fde2080579c43bc14d4c4b9b8fe89869a9fe395ded6342d2f0103a60e
MD5 fbac2d15c84ea387fe0dd8b6688fdc01
BLAKE2b-256 21c189d653d79290d0886e7f1f9dd44788a87047c603228e795e5143f4d33829

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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