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

@shihen.tsou/json-rag-core

v0.1.0-alpha.1

Published

JSON Source-of-Truth with hybrid retrieval (structured + vector + FTS) - Alpha Release

Downloads

5

Readme

@memoria/json-rag-core

⚠️ Alpha Release: APIs may change. Feedback welcome!

Lightweight JSON database with hybrid search capabilities (vector + full-text + structured).

🚀 Installation

npm i @memoria/json-rag-core@alpha

🎯 Quick Start

import { index, query } from '@memoria/json-rag-core'

// Index documents
await index([
  { id: '1', text: 'Authentication middleware at src/auth.js' },
  { id: '2', text: 'Database connection in src/db.js' },
  { id: '3', text: 'React components in src/components' }
])

// Query with hybrid search (keyword + semantic)
const results = await query('auth middleware')
console.log(results)
// [{ id: '1', snippet: 'Authentication middleware...', score: 0.95 }]

✨ Features

  • Hybrid search (keyword + semantic + structured)
  • Local-first - Your data stays on your device
  • Zero dependencies for core functionality
  • Chinese language support
  • Memory efficient - Optimized for large datasets
  • Fast indexing - Process thousands of documents in seconds
  • Vector embeddings (coming in 0.2.0)
  • Persistent storage (coming in 0.3.0)
  • Graph relationships (coming in 0.4.0)

📖 API Reference

index(docs)

Index one or more documents into the system.

await index({
  id: 'doc-1',
  text: 'Your content here',
  meta: { source: 'manual', category: 'docs' }
})

query(q, options)

Search indexed documents using hybrid search.

const results = await query('search terms', {
  limit: 10,        // Max results (default: 10)
  threshold: 0.7    // Similarity threshold (default: 0.7)
})

clear()

Clear all indexed data.

await clear()

🌟 Why JSON-RAG?

Unlike traditional vector databases that require complex setup and cloud services, JSON-RAG runs entirely locally with a simple npm install. Perfect for:

  • Personal AI assistants with memory
  • Documentation search in your apps
  • Code intelligence tools
  • Privacy-first applications
  • Offline-capable PWAs

🏗️ Architecture

┌─────────────────────────────────┐
│         Query Interface          │
├─────────────────────────────────┤
│      Hybrid Query Router         │
├─────┬───────────┬────────────┬──┤
│Vector│   FTS     │ Structured │  │
│Index │ Full-text │   JSON     │  │
├─────┴───────────┴────────────┴──┤
│    Local Storage Backend         │
└─────────────────────────────────┘

🔮 Roadmap

| Version | Features | Status | |---------|----------|--------| | 0.1.x | Basic hybrid search | ✅ Released | | 0.2.x | Vector embeddings | 🚧 In Progress | | 0.3.x | Persistent storage | 📅 Planned | | 0.4.x | Graph relationships | 💡 Ideation | | 1.0.0 | Production ready | 🎯 Q1 2026 |

🤝 Contributing

We welcome contributions! This is an alpha release and your feedback is invaluable.

# Clone the repo
git clone https://github.com/shihentsou/ai-orchestrator.git
cd ai-orchestrator/json-rag

# Install dependencies
npm install

# Run tests
npm test

📊 Performance

| Operation | Scale | Performance | Memory | |-----------|-------|-------------|--------| | Insert (single) | 1 doc | ~2ms | <10MB | | Batch Insert | 10K docs | ~1.2s | ~50MB | | Hybrid Query | 1M docs | ~25ms | ~250MB |

🛡️ License

MIT © 2025 Project Memoria Contributors

🔗 Related Projects

📬 Support


Note: This is an alpha release. Core APIs (index, query, clear) are relatively stable, but advanced features and options may change. We're actively developing and would love your feedback!