npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@spuentesp/lain

v0.1.6

Published

Language-Augmented Ingestion Network - Architectural brain for AI agents

Downloads

652

Readme

Lain

Structural Memory & Architectural Brain for AI Agents


The Microscope vs. The Telescope

Current AI coding agents rely on standard Language Server Protocols (LSP) or brute-force RAG. This approach excels at microscopic tasks (fixing a line, writing a function) but fails at macroscopic tasks (understanding system-wide impact, architectural refactoring, navigating massive decoupling).

Lain provides the "telescope." It builds a persistent, queryable knowledge graph of your entire project, combining:

  • Structural Memory: Every class, function, and relationship stored in a high-performance graph.
  • Architectural Reasoning: Identify "anchors" (central symbols) and "blast radius" for any change.
  • Git Intelligence: Understand which files change together (co-change analysis) and track knowledge staleness.
  • Local NLP: Semantic search over code symbols using high-performance ONNX embeddings (no API keys required).

Core Technologies

Lain is built for high-performance and local-first reliability:

  • KùzuDB: Native, persistent graph database for sub-millisecond relationship queries.
  • Git2: Embedded git integration for change detection and history analysis.
  • LSP Bridge: Multi-language support via standard Language Server Protocols.
  • ORT (ONNX Runtime): Local inference for all-MiniLM-L6-v2 embeddings.

Installation

Lain requires a Linux-compatible environment (Debian/Ubuntu) for KùzuDB stability. Docker is the recommended path for all platforms.

Option A: Docker (Recommended)

Add Lain to your MCP configuration (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "lain": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "/your/project/path:/workspace",
        "ghcr.io/spuentesp/lain:latest",
        "--workspace", "/workspace"
      ]
    }
  }
}

Option B: Cargo (Power Users)

If you are on Linux or have a configured C++ toolchain on macOS, you can install directly via Cargo:

cargo install --git https://github.com/spuentesp/lain.git
lain --workspace /path/to/project

Option C: Manual Build (Linux / WSL)

  1. Prerequisites: Ensure cmake, g++, pkg-config, and libssl-dev are installed.
  2. Clone & Build:
git clone https://github.com/spuentesp/lain.git
cd lain
cargo build --release
  1. Run:
./target/release/lain --workspace /path/to/your/project

Tools provided by Lain

Lain exposes 22 high-value tools to AI agents:

1. Architecture Exploration

  • get_layered_map: Returns symbols at a specific depth from entry points.
  • get_master_map: High-level summary of the entire system architecture.
  • get_entry_points: Identifies main functions and root modules.
  • find_anchors: Lists the most "central" symbols in the codebase.

2. Search & Navigation

  • search_symbols: Fast string-based search over symbols.
  • semantic_search: Intent-based search using local ONNX embeddings.
  • get_node_info: Detailed metadata for a specific code symbol.
  • get_outgoing_edges: Explore relationships (Calls, Uses, Inherits) for a symbol.

3. Impact & Health

  • get_blast_radius: Identifies all symbols affected by changing a specific symbol.
  • get_call_chain: Traces execution paths between symbols.
  • get_coupling_report: Shows which files are logically coupled based on git history.
  • get_health: Current state of the graph (nodes, edges, staleness).

How to use Lain as an AI Agent

Lain is designed to be the primary interface for coding agents. If you are an agent, call the get_agent_strategy tool to receive your operational manual.

Recommended Agent Flow:

  1. Orient: Call get_master_map to see the big picture.
  2. Explore: Call find_anchors to find the heart of the system.
  3. Trace: Call get_call_chain to understand how a feature is triggered.
  4. Safety: Call get_blast_radius before making any major refactor.

License

MIT - Copyright (c) 2026 spuentesp