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

yedan-graph-rag

v1.0.0

Published

Knowledge Graph RAG API with self-improving retrieval via experience replay. 5400+ entities, 5 retrieval interfaces.

Readme

Yedan Graph RAG API

A knowledge graph with 5400+ entities that actually learns from how you use it.

I built this because most RAG systems treat retrieval as a static lookup. This one uses experience replay — every query teaches it what works and what doesn't, so retrieval quality improves over time without any manual tuning.

What Makes It Different

  • 5 retrieval interfaces: keyword (FTS5), semantic (vectorize), graph walk, causal DAG, chunk read
  • Self-improving: Experience replay (RL-style) adjusts retrieval weights based on query outcomes
  • 5400+ entities, 1300+ relations, growing daily
  • Built on Cloudflare: Workers + D1 + Vectorize + KV. Runs globally, costs almost nothing.

API

# Query (simple)
curl -X POST https://yedan-graph-rag.yagami8095.workers.dev/query \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "machine learning applications", "type": "simple", "top_k": 5}'

# Add knowledge
curl -X POST https://yedan-graph-rag.yagami8095.workers.dev/ingest \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"entities": [{"id": "ml-101", "name": "Machine Learning", "type": "concept", "summary": "..."}]}'

# Stats
curl https://yedan-graph-rag.yagami8095.workers.dev/stats

Query Types

| Type | What It Does | When to Use | |------|-------------|-------------| | simple | Keyword + semantic hybrid | Quick factual lookups | | exploratory | Graph walk + related entities | "Tell me about X and everything connected" | | temporal | Time-aware retrieval | "What changed since last week?" | | causal | Causal DAG traversal | "Why did X happen?" | | multi_hop | Multi-step reasoning chain | Complex questions requiring inference |

Running Your Own

The whole thing runs on Cloudflare's free tier:

npm install
npx wrangler deploy

You'll need a D1 database and Vectorize index. Check wrangler.toml for the bindings.

Why I Built This

Most knowledge graphs are either too simple (just a JSON file) or too complex (requires a PhD to set up). I wanted something in between — production-ready, self-improving, and cheap to run.

The experience replay system was inspired by RL papers from NeurIPS 2024. Every time a query returns results, the system logs what was retrieved and whether it was useful. Over time, it learns which retrieval strategies work best for which types of questions.

License

MIT


If you're building RAG systems and want to chat about graph-based retrieval, feel free to open an issue. Always happy to nerd out about this stuff.