Socket
Book a DemoInstallSign in
Socket

lexforge

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

lexforge

LexForge is a framework for dynamic law parsing, designed to convert legal documents (such as statutes, directives, or regulations) into a generic, hierarchical data structure. This enables flexible analysis, research, and automation of legal content.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

LexForge

LexForge is a framework for dynamic law parsing, designed to convert legal documents (such as statutes, directives, or regulations) into a generic, hierarchical data structure. This enables flexible analysis, research, and automation of legal content.

Features

  • Dynamic Law Parsing: Parse legal documents into a tree-like structure with customizable levels (e.g., article, section, clause).
  • Generic Data Structure: Uses a flexible schema (powered by Zod) to represent any law's hierarchy and content.
  • Agent-Based Analysis: Modular agents and tools for analyzing, summarizing, or transforming legal text.
  • Extensible: Easily add new agents, tools, or support for additional law formats.

Setup

To run LexForge locally, you will need:

  • An Anthropic API key (for agent-based text analysis)
  • Node.js + npm installed

Install dependencies:

npm install

Set your API key:

export ANTHROPIC_API_KEY=sk-ant-api03-XXXXXX....

Start the LexForge server:

npm start

(Optional) Run the Inngest dev server for agent and network debugging:

npm run inngest-dev
# or
npx inngest-cli@latest dev -u http://localhost:3000/api/inngest

Usage

  • Add Law Files: Place your law documents (e.g., PDFs) in the law_files/ directory.
  • Run the Server: The agent(s) will process and analyze the documents, extracting summaries and (with further development) parsing the structure into the generic law tree.
  • Access the API: Use the API endpoints to interact with the parsed law data, summaries, or trigger further analysis.

Law Data Structure Example

The core data structure is a flexible tree, where each node can represent any level of a law (e.g., article, section, clause):

{
  levelName: "section",
  identifier: "1",
  content: "This section covers ...",
  children: [
    {
      levelName: "clause",
      identifier: "a",
      content: "Clause text ...",
      children: []
    }
  ]
}

Extending LexForge

  • Add new agents in src/agents/ for specialized analysis or extraction tasks.
  • Add new tools in src/tools/ to support different document types or processing steps.
  • Update the law schema in src/dataStructure.ts to support new law formats or metadata.

Learn More

LexForge is built on AgentKit and Zod. For more information on extending agents, networks, or tools, see the respective documentation.

FAQs

Package last updated on 04 Jul 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.