Langraph Integration#411
Draft
mohitcek wants to merge 10 commits into
Draft
Conversation
langraph demo notebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
uqlm.integrationspackage that lets any UQLM scorer be dropped into agent frameworks—starting with LangGraph—without modifying the scorers themselves.The design follows composition over inheritance:
integrations/base.py— defines theScorerAdapterprotocol and a global adapter registry (register_adapter/resolve_adapter). Scorer classes are never touched.integrations/langgraph/node.py—UQLMNode, an async-capable LangGraph node that reads a prompt (and optional response / precomputed scoring inputs) from the graph state, resolves the correct adapter for the wrapped scorer, runs it, and writes a uniform {output_key: payload} update back to the state. Includes amake_uqlm_nodefactory that returns a bare coroutine for direct use inStateGraph.add_node. Supports two modes:"score"(score precomputed responses, falling back to generation) and"generate_and_score".integrations/langgraph/adapters/— one adapter per scorer family, auto-registered on import:Each adapter normalizes its scorer's native sync/async API into a uniform {"scores", "responses", "extra"} payload.
Also includes:
UQLMNodeandmake_uqlm_nodeexported from the top-level uqlm package.uqlm/integrations/README.mddescribing the architecture and state contract.examples/integration/RagAgent/) withcorpus/retrieverhelpers and workflow diagram.Type of Change
Checklist
ruff checkandruff formatpass locally