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

@pi-unipi/cocoindex

v2.0.0

Published

CocoIndex integration for Pi — AST-aware content indexing, semantic vector search, and incremental pipeline management

Readme

@pi-unipi/cocoindex

CocoIndex integration for Pi coding agent — AST-aware content indexing, semantic vector search, and incremental pipeline management.

Overview

Replaces the compactor's FTS5-based content indexing with CocoIndex, providing:

  • AST-aware code chunking — language-aware splitting for code files
  • Semantic vector search — find content by meaning, not just keywords
  • Incremental indexing — only reprocesses changed files (delta-only)
  • LanceDB storage — zero-config, local file-based vector database
  • Shared embeddings — reuses memory package's OpenRouter API key and model

Prerequisites

  1. Python 3.10+
  2. CocoIndex CLI: pip install cocoindex 'cocoindex[lancedb]' (requires cocoindex >= 1.0)
  3. LanceDB SDK (optional, for search): npm install @lancedb/lancedb
  4. Embedding API key — configured via /unipi:memory-settings

Quick Start

# 1. Initialize the pipeline (once per project)
/unipi:cocoindex-init

# 2. Index the project
/unipi:cocoindex-update

# 3. Search indexed content
cocoindex_search({ query: "how does authentication work?" })

Architecture

Project files ──→ localfs.walk_dir (recursive)
                      │
                      ▼
              chunk_text (@coco.fn, memoized)
                      │
                      ▼
              LanceDB target (via ContextKey)
                      │
                      ▼
              Vector search → ranked results

Uses cocoindex v1.0+ App/fn/mount API with:

  • @coco.lifespan for async environment setup (LanceDB connection)
  • @coco.fn for memoized processing functions
  • coco.mount() / coco.mount_target() for component management
  • localfs.walk_dir for file enumeration
  • lancedb.TableTarget for row-level target state management

Tools

| Tool | Description | |------|-------------| | cocoindex_search | Search indexed content (semantic vector when available, LanceDB FTS when available, lexical fallback for text-only indexes) | | cocoindex_status | Check indexing status, freshness, doc count |

Commands

| Command | Description | |---------|-------------| | /unipi:cocoindex-update | Run incremental indexing | | /unipi:cocoindex-status | Show pipeline status | | /unipi:cocoindex-init | Scaffold default pipeline | | /unipi:cocoindex-settings | View configuration |

Configuration

  • Pipeline: .unipi/cocoindex/main.py — auto-generated, fully customizable
  • Data store: .unipi/cocoindex/.lancedb/
  • Embeddings: ~/.unipi/memory/config.json (shared with memory package)
  • Search fallback: Existing text-only LanceDB tables remain searchable through a lexical scan fallback when no vector column or FTS index exists

What Changed from FTS5

This package replaces compactor's content indexing subsystem:

| Feature | Before (FTS5) | After (CocoIndex) | |---------|---------------|-------------------| | Chunking | Heading/paragraph | AST-aware recursive | | Search | BM25 + trigram | Vector + full-text | | Incremental | No (full re-index) | Yes (delta-only) | | Storage | SQLite FTS5 | LanceDB |

Status

⚠️ Experimental — This is an experiment/cocoindex branch feature. Not yet merged to main.