langgraph4j  by langgraph4j

Java library for building stateful, multi-agent LLM apps, designed for Langchain4j and Spring AI

Created 1 year ago
892 stars

Top 40.6% on SourcePulse

GitHubView on GitHub
Project Summary

LangGraph4j provides a Java-native framework for building stateful, multi-agent applications powered by Large Language Models (LLMs). It enables developers to construct complex LLM workflows by defining nodes, edges, and state management, offering a structured approach to orchestrating agent interactions and tool usage.

How It Works

LangGraph4j is built around the concept of a StatefulGraph, parameterized by a state object that is passed between nodes. Nodes are functions that accept and return state updates, either setting or adding to specific state attributes defined by a schema. This schema uses Channels to represent state attributes, with AppenderChannel facilitating list accumulation. The library supports asynchronous operations via CompletableFuture and streaming responses using java-async-generator, with features like checkpoints for saving and replaying graph execution.

Quick Start & Requirements

  • Install: Add the langgraph4j-core dependency to your Maven project.
    <dependency>
        <groupId>org.bsc.langgraph4j</groupId>
        <artifactId>langgraph4j-core</artifactId>
        <version>1.5.8</version>
    </dependency>
    
  • Prerequisites: Java 17 or higher.
  • Resources: Official documentation and samples are available for integration with Langchain4j and Spring AI.

Highlighted Details

  • Supports stateful graphs, nodes, edges (including conditional), entry points, and schema definition.
  • Offers asynchronous and streaming support, checkpoints, and graph visualization (via PlantUML).
  • Integrates directly with Langchain4j for agent execution and tool usage.
  • Includes a playground web application for interactive graph testing.

Maintenance & Community

The project is actively maintained, with the latest release (1.5.8) on April 26, 2025. Community resources and integration examples are available, including links to projects like AIDEEPIN and Dynamo Multi AI Agent POC.

Licensing & Compatibility

The library is available under a standard open-source license, facilitating commercial use and integration with closed-source applications.

Limitations & Caveats

Graph visualization and a playground with breakpoint features are marked as "x" (not implemented) in the README's feature list, indicating these specific functionalities may be incomplete or unavailable.

Health Check
Last Commit

14 hours ago

Responsiveness

1 day

Pull Requests (30d)
7
Issues (30d)
20
Star History
116 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.