Skip to main content

Get Your Nordlys API Key

Sign up here to create an account and generate your API key.

Overview

LangGraph is a low-level orchestration framework for building stateful, multi-actor applications with AI models. By integrating Nordlys with LangGraph’s ChatOpenAI, you get advanced Nordlys model while building complex agent workflows with graphs, state management, and tool integration.

Key Benefits

  • Keep existing workflows - No changes to your LangGraph graph structure
  • Nordlys model - Automatic Nordlys model for each agent interaction
  • Cost optimization - 30-70% cost reduction across agent executions
  • Stateful agents - Works seamlessly with LangGraph’s state management
  • Tool support - Nordlys selects function-calling capable models automatically
  • Streaming support - Real-time responses in agent workflows

Installation

Basic Usage

Initialize ChatOpenAI with Nordlys

The only change needed is to point LangGraph’s ChatOpenAI to Nordlys’s endpoint:

Simple Chatbot with StateGraph

Advanced Examples

Agent with Tools

Nordlys automatically selects models that support function calling when tools are detected:

Streaming Agent Responses

Multi-Agent Workflow

Integration Patterns

With Memory/Checkpointing

Human-in-the-Loop

Configuration Options

Model Selection

Use the Nordlys model ID:

Temperature and Parameters

All standard ChatOpenAI parameters work with Nordlys:

Best Practices

  1. Use nordlys/hypernova across agent nodes
  2. Different temperatures for different agents (research vs creative)
  3. Leverage checkpointing for stateful conversations with memory
  4. Use conditional edges for complex agent logic
  5. Add human-in-the-loop for critical decisions with interrupt points
  6. Tool integration - keep tool calls explicit and deterministic

Error Handling

Nordlys retries transient errors automatically. For comprehensive error handling patterns, see the Error Handling Guide.

Complete Example

See the complete LangGraph example for a full working implementation including:
  • Stateful agent with memory
  • Tool integration with conditional Nordlys model
  • Multi-agent workflows
  • Streaming responses
  • Human-in-the-loop patterns
  • Error handling

Next Steps