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

slorg

v1.0.0

Published

LLM-powered search engine library with knowledge graph generation

Readme

Slorg

An AI-powered search engine with knowledge graph generation.

Installation

npm install -g slorg

Usage

As a CLI tool

# Set your OpenAI API key
export OPENAI_API_KEY=your_api_key_here

# Run a search
slorg "What is the capital of France?"

# Or provide the API key directly
slorg -k your_api_key_here "What is the capital of France?"

# Specify a model
slorg -m gpt-4o "What is the capital of France?"

# Limit results
slorg -r 3 "What is the capital of France?"

As a server

# Start the server
slorg server

# Start the server on a specific port
slorg server -p 8080

# Start the server with API key
slorg server -k your_api_key_here

# Or set the API key as an environment variable
export OPENAI_API_KEY=your_api_key_here
slorg server

The server exposes two endpoints:

  • GET /health - Health check endpoint
  • POST /search - Search endpoint that accepts JSON with query, model, and maxResults fields

Example server usage:

curl -X POST http://localhost:3000/search \
  -H "Content-Type: application/json" \
  -d '{"query": "What is the capital of France?", "model": "gpt-4o", "maxResults": 3}'

As a library

import SlorgSearch from 'slorg';

const searcher = new SlorgSearch('your-openai-api-key');

const results = await searcher.search('What is the capital of France?', {
  model: 'gpt-4o-mini',
  maxResults: 5
});

console.log(results.answer);
console.log(results.knowledgeGraph);
console.log(results.keywords);
console.log(results.results);

Environment Variables

The following environment variables can be used to configure Slorg:

  • OPENAI_API_KEY - Your OpenAI API key (required)
  • OPENAI_BASE_URL - Custom OpenAI API base URL (optional)
  • SLORG_DEFAULT_MODEL - Default model to use (default: "gpt-4o-mini")
  • SLORG_SEARCH_API_URL - Search API URL (default: "https://search-dev.d736.uk/search")
  • SLORG_SEARCH_ENGINES - Comma-separated list of search engines (default: "google,yahoo,bing,duckduckgo")
  • SLORG_SEARCH_LIMIT - Maximum number of search results (default: "20")
  • PORT - Port for the server (default: 3000)

Features

  • AI-powered search with natural language understanding
  • Knowledge graph generation for search queries
  • Keyword extraction for improved search results
  • Web content scraping and analysis
  • Token usage tracking
  • Configurable OpenAI models
  • Both CLI and server modes
  • Environment variable configuration

API

new SlorgSearch(apiKey)

Create a new SlorgSearch instance with your OpenAI API key.

search(query, options)

Perform a search with the given query.

Options:

  • model: The OpenAI model to use (default: 'gpt-4o-mini')
  • maxResults: Maximum number of results to return (default: 5)

Returns a Promise that resolves to an object with:

  • answer: The LLM-generated answer
  • knowledgeGraph: Structured representation of the query
  • keywords: Extracted search keywords
  • results: Array of search results with scores
  • tokenCount: Total tokens used in the search

License

MIT