Socket
Book a DemoInstallSign in
Socket

@ag-kit/adapter-langgraph

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-kit/adapter-langgraph

LangGraph adapter for AG-Kit agents

latest
npmnpm
Version
0.0.10
Version published
Weekly downloads
138
-41.53%
Maintainers
2
Weekly downloads
 
Created
Source

@ag-kit/adapter-langgraph

LangGraph adapter for AG-Kit agents. This package provides integration between AG-Kit and LangGraph framework, enabling you to use LangGraph workflows with AG-Kit's agent infrastructure.

Installation

npm install @ag-kit/agents @ag-kit/adapter-langgraph

Features

  • LangGraphAgent: Agent implementation that works with compiled LangGraph workflows
  • TDAISaver: Checkpoint saver implementation using TDAI Memory
  • TDAIStore: Store implementation for LangGraph using TDAI Memory
  • AGKitStateAnnotation: Pre-configured state annotation for AG-Kit integration

Usage

Basic Agent Setup

import { StateGraph, START, END } from "@langchain/langgraph";
import { AGKitStateAnnotation, LanggraphAgent } from "@ag-kit/adapter-langgraph";
import { AgentConfig } from "@ag-kit/agents/abstract";

// Create your LangGraph workflow
const workflow = new StateGraph(AGKitStateAnnotation)
  .addNode("chat_node", chatNode)
  .addEdge(START, "chat_node")
  .addEdge("chat_node", END);

const compiledWorkflow = workflow.compile();

// Create the agent
const agent = new LanggraphAgent({
  name: "my-langgraph-agent",
  description: "A LangGraph agent",
  compiledWorkflow,
});

Using TDAISaver for Checkpoints

import { TDAISaver } from "@ag-kit/adapter-langgraph";
import { MemoryClient } from "@ag-kit/agents";

const memoryClient = new MemoryClient({
  endpoint: "https://api.tdai.com",
  apiKey: "your-api-key",
  memoryId: "your-memory-id",
});

const checkpointer = new TDAISaver({
  endpoint: "https://api.tdai.com",
  apiKey: "your-api-key",
  memoryId: "your-memory-id",
});

const compiledWorkflow = workflow.compile({
  checkpointer,
});

Using TDAIStore

import { TDAIStore } from "@ag-kit/adapter-langgraph";
import { MemoryClient } from "@ag-kit/agents";

const memoryClient = new MemoryClient({
  endpoint: "https://api.tdai.com",
  apiKey: "your-api-key",
  memoryId: "your-memory-id",
});

const store = new TDAIStore({
  memoryClient,
  sessionId: "session-123",
});

API Reference

LanggraphAgent

Agent class that extends AbstractAgent and works with compiled LangGraph workflows.

Constructor:

constructor(config: AgentConfig & { compiledWorkflow: CompiledStateGraph })

TDAISaver

Checkpoint saver implementation for LangGraph using TDAI Memory.

Constructor:

constructor(config: TDAISaverConfig)

TDAIStore

Store implementation for LangGraph using TDAI Memory.

Constructor:

constructor(config: TDAIStoreConfig)

Requirements

  • @ag-kit/agents: Core agent functionality
  • @langchain/langgraph: LangGraph framework
  • @langchain/core: LangChain core utilities
  • rxjs: Reactive extensions for JavaScript
  • AG-Kit Documentation
  • LangGraph Documentation
  • AG-Kit Examples

Keywords

ag-kit

FAQs

Package last updated on 06 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts