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

@keleshteri/pageindex-rag

v1.0.11

Published

Vectorless RAG using LLM-driven hierarchical document indexing — PDF and Markdown/Obsidian vault support

Downloads

1,716

Readme

pageindex-rag

Vectorless RAG using LLM-driven hierarchical document indexing — for PDF and Markdown files (including Obsidian vaults).

No embeddings. No vector database. The LLM reads the document structure once, builds a tree index, and then navigates that tree to answer questions.

Based on VectifyAI/PageIndex. Extended with multi-LLM provider support, Obsidian vault indexing, and a dependency security checker.


What was added over the original

| Feature | Original | This fork | |---|---|---| | LLM providers | Anthropic only | Anthropic · OpenAI · Ollama · Claude Code (no API key) | | Markdown indexing | — | Single file and full vault/folder | | Obsidian vault support | — | --vault <dir> CLI flag | | npm security rules | — | npm run security (age + CVE checks) | | Env-var model override | — | PAGEINDEX_MODEL in .env |


Installation

npm install @keleshteri/pageindex-rag

Requires Node.js 18+ (uses built-in fetch).


Quick start

import { PageIndexClient } from '@keleshteri/pageindex-rag';

const client = new PageIndexClient({
  model: 'gpt-4o',           // or 'claude-sonnet-4-6', 'claude-code', 'ollama/llama3'
  workspace: './workspace',  // optional: persists indexes to disk
});

// Index a PDF
const docId = await client.index('./report.pdf');

// Index a Markdown file
const noteId = await client.index('./notes.md');

// Index an entire Obsidian vault
const results = await client.indexVault('./MyVault', { concurrency: 3 });

// Retrieve
const structure = client.getDocumentStructure(docId);
const pages     = await client.getPageContent(docId, '3-5');

LLM options

Set the model in .env or pass it directly to PageIndexClient.

Anthropic

ANTHROPIC_API_KEY=sk-ant-...
PAGEINDEX_MODEL=claude-sonnet-4-6

OpenAI

OPENAI_API_KEY=sk-...
PAGEINDEX_MODEL=gpt-4o

Claude Code — no API key needed

Uses your local Claude Code session. Requires the claude CLI to be installed and logged in.

PAGEINDEX_MODEL=claude-code

Ollama — fully local, no API key needed

ollama pull llama3
PAGEINDEX_MODEL=ollama/llama3
# OLLAMA_BASE_URL=http://localhost:11434/v1  # override if needed

CLI

# Single PDF
npx ts-node src/cli.ts --pdf report.pdf

# Single Markdown file
npx ts-node src/cli.ts --md notes.md

# Entire Obsidian vault
npx ts-node src/cli.ts --vault ~/Documents/MyVault

# Use a specific model
npx ts-node src/cli.ts --pdf report.pdf --model gpt-4o

# Options
#   --no-summary        skip per-node summaries (faster)
#   --add-description   generate a one-sentence doc description
#   --add-text          include raw page text in the output
#   --output <path>     custom output path (single-file mode only)

Output is saved to results/ as JSON.


Programmatic API

const client = new PageIndexClient(options);

// Index
await client.index(filePath)               // auto-detects pdf/md
await client.indexVault(dirPath)           // all .md files in a folder

// Retrieve
client.getDocument(docId)                  // metadata (name, type, page count)
client.getDocumentStructure(docId)         // full tree (no raw text)
await client.getPageContent(docId, pages)  // pages: "1-3", "5,8", "12"
client.listDocuments()                     // all indexed docs

The three retrieve functions return JSON strings — they are designed to be passed directly as LLM tool-use callbacks.


Security

npm run security   # checks all deps: age (< 14 days → blocked) + npm audit

See scripts/check-deps.js for thresholds and rules.


Development

npm run build   # compile TypeScript → dist/
npm run dev     # watch mode

Copy .env.example to .env and configure your LLM provider before running.


Credits

This project is a fork of VectifyAI/PageIndex, licensed under MIT.

License

MIT — see LICENSE.