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 🙏

© 2025 – Pkg Stats / Ryan Hefner

triplie

v0.3.40

Published

An IRC conversation simulator (chatbot) utilising Markov chains, Hebbian networks and information theory.

Downloads

178

Readme

INTRODUCTION

Triplie is an AI bot based on 2nd up to 5th order Markov model. It uses an SQLite database for storage.

Triplie learns by creating

  1. a dictionary of words
  2. a graph representing valid 5-grams (consecutive groups of 5 words) encountered in the text
  3. a graph of associations between words from sentences formed according to the Hebbian rule

To respond to a user, triplie extracts keywords from the user's text, finds their most appropriate associated keywords in the Hebbian association network, and generates replies that contain the associated keywords using multiple breadth-first-search Markov chains algorithm.

For more information on installing and configuring read below

You can join the project's IRC channel too: #triplie on irc.freenode.net

Install

Prerequisites

Download and install node.js for your system. Its recommended to build node from source. If you don't do that, make sure that npm is also installed alongside with node and that the node binary is called "node"

Then from a terminal run:

npm install -g triplie

This will install the triplie command on your system.

Configure the bot as explained below before running!

CONFIGURATION

If running the bot for the first time and its not configured, you should create a new directory and run:

triplie config.yaml --init

to create the initial config file

Edit config.yaml

config.yaml is already pre-filled with some default for your bot. You will want to change some of these settings.

The configuration file is really well commented. Open it and edit it according to the instructions contained inside. Once you run the bot however, the instructions will disappear the moment you change a setting by giving a command to the bot.

RUNNING

After you edited the config file, to run the bot use the command:

triplie config.yaml

IMPORT EXISTING TEXT

If called with the argument --feed triplie will receive data from stdin, parse it using a regular expression then feed the database.

Example:

cat log.txt | triplie config.yaml --feed --regex '(?<year>\d+)-(?<month>\d+)-(?<day>)T(?<hour>\d+):(?<minute>\d+):(?<second>\d+)Z\s+(?<nick>.+):\s+(?<text>.+)'

will work for a log.txt that has lines in the format:

2013-04-04T13:15:00Z someuser: I wrote some text

The syntax is XRegExp and uses named groups. See the XRegExp readme for more info

Currently, supported named captures are:

  • year
  • month
  • day
  • hour
  • minute
  • second
  • timestamp - unix timestamp in seconds, used instead of the date captures
  • timestampms - unix timestamp in miliseconds, used instead of both above.
  • text - the text content

Timestamp example:

cat log.txt | triplie config.yaml --feed --regex '(?<timestamp>\d+) (?<text>.+)

will match log.txt containing lines in the format:

1234567890 example text here

All captures except text are optional - the time is optional and if left out the feeder will generate reasonable "fake" timestamps.

cat log.txt | triplie config.yaml --feed --regex '(?<text>.+)'

COMMANDS

List of triplie's commands (assuming "!" is the cmdchar)

  1. !join #channel - causes the bot to join and remember the channel

  2. !part #channel - part and forget channel

  3. !reload - causes reload of the bot code, useful for development

  4. !set path value - set a config setting to the specified value. Examples

    !set ai.sleep.1 10 - Set the upper sleep limit to 10 seconds
    !set ai.sleep [2,3] - Set both sleep limits. Value musn't contain space.
  5. !get path - get the config value at the specified path

  6. !db stats - triplie will output database statistics

!cmd will return results via private notice

!!cmd returns results via public message

LICENCE & AUTHOR

See LICENCE and AUTHORS (if present)

Bitdeli Badge