New:Socket for Asana Is Now Available.Learn more
Get Started

linforge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linforge

Embeddable workbench for LangGraph Agent apps — edit, run, debug, and monitor in one place

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
8
14.29%
Maintainers
1
Weekly downloads
 
Created
Source

Linforge

简体中文

Embeddable workbench for LangGraph Agent apps — edit, run, debug, and monitor in one place.

Built by LianBuilds

Features

  • Visual graph editor — drag-and-drop nodes, smart edge routing, blueprint and replay modes
  • Prompt versioning — edit, save, and activate prompt templates per node with full version history
  • Run & replay — trigger agent runs, view step-by-step execution timeline with state diffs
  • Template system — 4 built-in graph templates (ReAct, Pipeline, Map-Reduce, Human-in-the-Loop)
  • Store interface — pluggable persistence via GraphStore, RunStore, StepPersister, PromptStore
  • One-line integration<LinforgeWorkbench> component embeds the full workbench in any React app
  • Koa server routesmountRoutes() adds 15 REST endpoints for graph, run, prompt, and template management

Quick Start

1. Install

npm install linforge
# peer dependencies
npm install react react-dom @xyflow/react koa @koa/router

2. Server

import Koa from 'koa';
import Router from '@koa/router';
import {
  NodeRegistry,
  defineNode,
  RunManager,
  GraphCompiler,
} from 'linforge/core';
import { mountRoutes } from 'linforge/server';
import {
  MemoryGraphStore,
  MemoryRunStore,
  MemoryStepPersister,
  MemoryPromptStore,
} from 'linforge/testing';

// Define nodes
const greeter = defineNode({
  name: 'greeter',
  description: 'Says hello',
  execute: async (state) => ({ ...state, message: 'Hello!' }),
});

// Set up registry
const registry = new NodeRegistry();
registry.register(greeter);

// Mount routes
const app = new Koa();
const router = new Router();

mountRoutes(router, {
  registry,
  graphStore: new MemoryGraphStore(),
  runStore: new MemoryRunStore(),
  stepPersister: new MemoryStepPersister(),
  promptStore: new MemoryPromptStore(),
  compilerFactory: (reg) => new GraphCompiler(reg),
  runManagerFactory: (compiler) => new RunManager(compiler),
});

app.use(router.routes());
app.listen(3001);

3. Frontend

import { LinforgeWorkbench } from 'linforge/react';
import '@xyflow/react/dist/style.css';

function App() {
  return (
    <LinforgeWorkbench apiBase="http://localhost:3001" basePath="/linforge" />
  );
}

Subpath Imports

Import pathDescription
linforgeRe-exports all submodules
linforge/coreNode definition, registry, compiler, runner
linforge/serverKoa route mounting
linforge/reactReact components and hooks
linforge/testingIn-memory store adapters for testing

Peer Dependencies

PackageVersionRequired for
react^18.0.0 || ^19.0.0linforge/react
react-dom^18.0.0 || ^19.0.0linforge/react
@xyflow/react^12.0.0linforge/react
koa^3.0.0linforge/server
@koa/router^15.0.0linforge/server

All peer dependencies are optional — install only what you need.

Note: When using linforge/react, you must import the React Flow stylesheet:

import '@xyflow/react/dist/style.css';

API Overview

Core

ExportDescription
defineNode(options)Create a typed node definition
NodeRegistryRegister/discover nodes
GraphCompilerCompile graph definitions to LangGraph StateGraph
RunManagerExecute graphs with abort, steps, and callbacks
createPromptLoader()Store-backed prompt loading with cache
TemplateRegistryRegister and list graph templates
applyTemplate()Instantiate a template into a graph definition
withStepRecording()Wrap node functions for automatic step recording

Server

ExportDescription
mountRoutes(router, opts)Mount 15 REST routes on a Koa router

React

ExportDescription
<LinforgeWorkbench>All-in-one workbench (graph list + canvas + runs)
<GraphCanvas>Graph editor with blueprint and replay modes
<RunPanel>Run trigger, history, and step timeline
<PromptEditor>Prompt template editing with versioning
<NodePropertyPanel>Inline node property editing
<StepDetailPanel>Step execution detail with state diff
useLinforgeGraph()Hook for graph data fetching and mutation
useLinforgeRuns()Hook for run management and step polling
useLinforgePrompt()Hook for prompt version CRUD

Testing

ExportDescription
MemoryGraphStoreIn-memory graph store
MemoryRunStoreIn-memory run store
MemoryStepPersisterIn-memory step persister
MemoryPromptStoreIn-memory prompt store

License

MIT

Keywords

langgraph

FAQs

Package last updated on 24 Feb 2026

Related posts