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

@tekmidian/pai

v0.4.0

Published

PAI Knowledge OS — Personal AI Infrastructure with federated memory and project management

Readme


links: "[[Ideaverse/AI/PAI/PAI|PAI]]"

PAI Knowledge OS

Claude Code has a memory problem. Every new session starts cold — no idea what you built yesterday, what decisions you made, or where you left off. You re-explain everything, every time. PAI fixes this.

Install PAI and Claude remembers. Ask it what you were working on. Ask it to find that conversation about the database schema. Ask it to pick up exactly where the last session ended. It knows.


What You Can Ask Claude

Searching Your Memory

  • "Search your memory for authentication" — finds past sessions about auth, even with different words
  • "What do you know about the Whazaa project?" — retrieves full project context instantly
  • "Find where we discussed the database migration" — semantic search finds it even if you phrase it differently
  • "Search your memory for that Chrome browser issue" — keyword and meaning-based search combined

Managing Projects

  • "Show me all my projects" — lists everything PAI tracks with stats
  • "Which project am I in?" — auto-detects from your current directory
  • "What's the status of the PAI project?" — full project details, sessions, last activity
  • "How many sessions does Whazaa have?" — project-level session history

Navigating Sessions

  • "List my recent sessions" — shows what you've been working on across all projects
  • "What did we do in session 42?" — retrieves any specific session by number
  • "What were we working on last week?" — Claude knows, without you re-explaining
  • "Clean up my session notes" — auto-names unnamed sessions and organizes by date

Keeping Things Safe

  • "Back up everything" — creates a timestamped backup of all your data
  • "How's the system doing?" — checks daemon health, index stats, embedding coverage

Obsidian Integration

  • "Sync my Obsidian vault" — updates your linked vault with the latest notes
  • "Open my notes in Obsidian" — launches Obsidian with your full knowledge graph

Zettelkasten Intelligence

  • "Explore notes linked to PAI" — follow trains of thought through wikilink chains
  • "Find surprising connections to this note" — discover semantically similar but graph-distant notes
  • "What themes are emerging in my vault?" — detect clusters of related notes forming new ideas
  • "How healthy is my vault?" — structural audit: dead links, orphans, disconnected clusters
  • "Suggest connections for this note" — proactive link suggestions using semantic + graph signals
  • "What does my vault say about knowledge management?" — use the vault as a thinking partner

Quick Start

Tell Claude Code:

Clone https://github.com/mnott/PAI and set it up for me

Claude finds the setup skill, checks your system, runs the interactive wizard, and configures itself. You answer a few questions — simple mode or full mode, where your projects live, whether you use Obsidian — and Claude does the rest.


Auto-Compact Context Window

Claude Code can automatically compact your context window when it fills up, preventing session interruptions mid-task. PAI's statusline shows you at a glance whether auto-compact is active.

Why the GUI setting doesn't work

Claude Code has an autoCompactEnabled setting in ~/.claude.json, but it gets overwritten on every restart. Do not use it — changes don't survive.

The durable approach: environment variable

Set CLAUDE_AUTOCOMPACT_PCT_OVERRIDE in your ~/.claude/settings.json under the env block. This survives restarts, /clear, and Claude Code updates.

{
  "env": {
    "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "80"
  }
}

The value is the context percentage at which compaction triggers. 80 means compact when the context window reaches 80% full. Restart Claude Code after saving.

Statusline indicator

Once set, PAI's statusline shows [auto-compact:80%] next to the context meter on line 3, so you always know auto-compact is active and at what threshold.

Set it up with one prompt

Give Claude Code this prompt and it handles everything:

Add CLAUDE_AUTOCOMPACT_PCT_OVERRIDE set to 80 to the env block in ~/.claude/settings.json. This enables durable auto-compact that survives restarts. Do not touch ~/.claude.json — that file gets overwritten on startup. After saving, confirm the setting is in place and tell me to restart Claude Code.


Storage Options

PAI offers two modes, and the setup wizard asks which you prefer.

Simple mode (SQLite) — Zero dependencies beyond Bun. Keyword search only. Great for trying it out or for systems without Docker.

Full mode (PostgreSQL + pgvector) — Adds semantic search and vector embeddings. Finds things by meaning, not just exact words. "How does the reconnection logic work?" finds the right session even if it never used those exact words. Requires Docker.


Prerequisites

  • Buncurl -fsSL https://bun.sh/install | bash
  • Docker — only for full mode
  • Claude Code
  • macOS or Linux

How It Works

A background service runs quietly alongside your work. Every five minutes it indexes your Claude Code projects and session notes — chunking them, hashing them for change detection, and storing them in a local database. When you ask Claude something about past work, it searches this index by keyword, by meaning, or both, and surfaces the relevant context in seconds.

Everything runs locally. No cloud. No API keys for the core system.

For the technical deep-dive — architecture, database schema, CLI reference, and development setup — see ARCHITECTURE.md.


Zettelkasten Intelligence

PAI implements Niklas Luhmann's Zettelkasten principles as six computational operations on your Obsidian vault.

How it works

PAI indexes your entire vault — following symlinks, deduplicating by inode, parsing every wikilink — and builds a graph database alongside semantic embeddings. Six tools then operate on this dual representation:

| Tool | What it does | |------|-------------| | pai zettel explore | Follow trains of thought through link chains (Folgezettel traversal) | | pai zettel surprise | Find notes that are semantically close but far apart in the link graph | | pai zettel converse | Ask questions and let the vault "talk back" with unexpected connections | | pai zettel themes | Detect emerging clusters of related notes across folders | | pai zettel health | Structural audit — dead links, orphans, disconnected clusters, health score | | pai zettel suggest | Proactive connection suggestions combining semantic similarity, tags, and graph proximity |

All tools work as CLI commands (pai zettel <command>) and MCP tools (zettel_*) accessible through the daemon.

Vault Indexing

The vault indexer follows symlinks (critical for vaults built on symlinks), deduplicates files by inode to handle multiple paths to the same file, and builds a complete wikilink graph with Obsidian-compatible shortest-match resolution.

  • Full index: ~10 seconds for ~1,000 files
  • Incremental: ~2 seconds (hash-based change detection)
  • Runs automatically via the daemon scheduler

Companion Projects

PAI works great alongside these tools (also by the same author):

  • Whazaa — WhatsApp bridge for Claude Code (voice notes, screenshots, session routing)
  • Coogle — Google Workspace MCP daemon (Gmail, Calendar, Drive multiplexing)
  • DEVONthink MCP — DEVONthink integration for document search and archival

Acknowledgments

PAI Knowledge OS is inspired by Daniel Miessler's concept of Personal AI Infrastructure and his Fabric project — a Python CLI for augmenting human capabilities with reusable AI prompt patterns. Fabric is excellent and solves a different problem; PAI takes the same philosophy in a different direction: persistent memory, session continuity, and deep Claude Code integration. See FEATURE.md for a detailed comparison.


License

MIT


Links: [[Ideaverse/AI/PAI/PAI|PAI]]