langgraphjs Documentation

repository·main·Indexed 25 days ago

https://github.com/langchain-ai/langgraphjs

An Angular SDK for building AI-powered applications using LangChain and LangGraph, featuring a Signals-first API built on the v2 streaming protocol. Includes documentation on the graph.streamEvents v3 API for consuming protocol events, messages, and subgraphs, as well as implementing human-in-the-loop workflows with interrupt/resume. Provides examples for agentic UI integration with @langchain/react and state persistence using MongoDBSaver.

Tokens
222.3K
Snippets
515
Records
1.1K
Agent score
83%

What's inside langgraphjs

  1. Overview of LangGraph Platform components

    main

    LangGraph Platform is a commercial solution for deploying agentic applications built on the open-source LangGraph framework. It consists of several key components:

    • LangGraph Server: Provides an opinionated API and architecture for deploying agentic applications, handling infrastructure concerns like streaming, background runs, and persistence.
    • LangGraph Studio: A specialized IDE that connects to a LangGraph Server for local visualization, interaction, and debugging.
    • LangGraph CLI: A command-line interface for interacting with a local LangGraph instance.
    • Python/JS SDK: A programmatic interface to interact with deployed LangGraph applications.
    • Remote Graph: Allows interacting with any deployed LangGraph application as if it were running locally.
  2. Overview of LangGraph features

    main

    LangGraph is a low-level orchestration framework designed for building controllable, stateful agents. Key capabilities include:

    • Durable execution: Agents can persist through failures and resume from their last state.
    • Human-in-the-loop: Allows for inspecting and modifying agent state during execution for human oversight.
    • Comprehensive memory: Supports both short-term working memory for reasoning and long-term persistent memory across sessions.
    • Observability: Integrates with LangSmith for tracing execution paths, state transitions, and runtime metrics.
    • Production-ready deployment: Designed for scalable, long-running stateful workflows.
  3. Overview of the Functional API

    main

    The Functional API allows you to add LangGraph features like persistence, memory, human-in-the-loop (interrupts), and streaming to your existing code with minimal changes. Unlike the Graph API which requires a DAG structure, the Functional API works with standard language primitives like if statements, for loops, and function calls.

    Key building blocks:

    • entrypoint: A wrapper that takes a function as the starting point of a workflow. It manages execution flow, long-running tasks, and interrupts.
    • task: Represents a discrete unit of work (e.g., an API call) that can be executed asynchronously within an entrypoint. Tasks return a future-like object that can be awaited.
  4. Overview of @langchain/vue features

    main

    The @langchain/vue SDK provides a Composition-API–first binding for LangGraph and LangChain using the v2 streaming protocol. Key features include:

    • v2-native streaming: Session-based transport with automatic re-attach on component remount.
    • Selector-based subscriptions: Uses ref-counted use* selectors to stream namespaced data (subagents, subgraphs, media) only when a component is mounted, optimizing performance.
    • Agent-brand type inference: useStream<typeof agent>() automatically unwraps state, tool calls, and subagent state maps.
    • Multimodal support: Built-in handling for audio, images, video, and files.
    • Suspense-friendly: Provides hydrationPromise to gate async setup() during initial hydration.
    • Discriminated transports: Typed union for Hosted Agent Server and custom adapters to prevent configuration errors.
  5. Overview of AI Elements Agentic UI Features

    main

    The AI Elements example demonstrates a production-quality agentic UI using @langchain/react and AI Elements components. Key features include:

    • Tool Call Rendering: Uses Tool, ToolHeader, ToolContent, ToolInput, and ToolOutput to display live updates of tool invocations.
    • Reasoning Display: Uses Reasoning blocks that auto-open during streaming and collapse when complete.
    • Streaming Messages: Uses Message, MessageContent, and MessageResponse for markdown streaming via Streamdown.
    • Conversation Management: Uses Conversation, ConversationContent, and ConversationScrollButton for auto-scrolling and jump-to-bottom functionality.
    • Input & Suggestions: Provides PromptInput (with PromptInputBody, PromptInputTextarea, etc.) and Suggestions for preset prompts.
  6. Overview of LangGraph Studio

    main

    LangGraph Studio is a specialized agent IDE designed for developing LLM applications. It provides visual graphs, interactive testing, and debugging capabilities for complex agentic workflows. It integrates with LangSmith to facilitate collaborative debugging and allows you to add node inputs/outputs to LangSmith datasets for testing.

    Key Features:

    • Graph Visualization: View your agent's workflow visually.
    • Interactive Testing: Run your graph directly from the UI.
    • State Debugging: Modify the agent's state and rerun to debug specific behaviors.
    • Assistant & Thread Management: Create and manage assistants and view/manage threads and long-term memory.
    • LangSmith Integration: Connect node data to datasets for testing.