mh825's profile picture
mh825

rss-rag-cache

Public

Version 1.7.0

202 Downloads

1 star

README

πŸ“‘ RSS RAG Cache Plugin for LM Studio

Version 1.8.0

Turn LM Studio into your own private, intelligent news archive. This plugin fetches your favorite RSS feeds, chunks the articles, embeds them using your local LM Studio server, and stores them in a local SQLite database for Retrieval-Augmented Generation (RAG).

Instead of searching the web, your LLM can instantly query your local cache of recent articles, blog posts, and newsletters.

✨ Features

  • Local RAG Pipeline: Fetches RSS feeds, chunks text, and generates embeddings via LM Studio's local server.
  • Hybrid Search (BM25 + RRF): Combines two SQLite FTS5 indexes (trigram for CJK/substrings, and porter unicode61 for real BM25 word ranking) with a resident in-memory vector index (falling back to a bounded SQL scan when the matrix would exceed the memory ceiling), fused by Reciprocal Rank Fusion. Active filters (feed / author / tag / collection / date range) are resolved to an entry-ID allow-list before ranking, so both keyword lists and the vector scan only score in-scope articles β€” a filtered search on a large cache costs time proportional to the matches, not to the cache. If the embedding model is offline, it automatically falls back to pure keyword search.
  • Contextual Chunk Embeddings: Each chunk is embedded as title | section breadcrumb + newline + chunk (embed style contextual-v2), so summary-only feeds and mid-article passages still produce self-contained vectors. Document/query inputs then receive model-aware asymmetric prefixes (search_document: / search_query: for nomic-embed-text-*, Represent this sentence… for bge/mxbai/snowflake). The stored/displayed text is unchanged. Switchable via contextualChunks; caches on older embed styles are upgraded lazily by reindex_missing_embeddings.
  • Heading Breadcrumbs: <h1>–<h3> are preserved as Markdown headings during extraction, and each chunk records the heading path that was active where the chunk ends (e.g. Title > Setup > Windows), so expanded context tells the model where a passage came from.
  • Small-to-Big Context: Each search hit is expanded to include up to contextChunks neighbouring chunks, so the returned snippet carries surrounding context rather than an isolated passage.
  • Fast, Incremental Vector Index: All embeddings are packed once into a single, densely-packed, pre-normalised Float32Array, so a semantic query is one tight dot-product loop with zero per-query allocation. The index is then maintained in place: newly indexed chunks append into recycled slots (tombstones tracked through an O(1) free list) and removed articles are tombstoned, so refreshes and retention no longer rebuild the whole matrix. It still rebuilds on a dimension change or when tombstones exceed 20% of capacity; a configurable byte ceiling (RSS_RAG_INDEX_MAX_MB, default 256 MB, with 15% headroom) falls back to the streaming scan when exceeded.
  • Feed Auto-Discovery: manage_rss_feeds accepts a blog homepage and follows <link rel="alternate" type="application/rss+xml|atom+xml"> to the real feed, adding that instead. The granular test_feed reports any discovered alternates.
  • Per-Feed TTL & Collections: feeds.json supports a per-feed retentionDays override and a collection label; retention honours the override, and search can be scoped with the collection filter.
  • Agent-Optimized Tool Surface: The default surface has four RSS tools and three read-only research contract tools. One multiplexed admin_rss_cache tool (gated by enableAdminTools) covers diagnostics/optimization/reindexing/debug, and the legacy one-purpose tools come back with exposeGranularAdminTools.
  • Research Cache Contract 1.0: cache_info, search_cache, and get_cached_item expose the existing local cache under plugin ID mh825/rss-rag-cache. Search uses the existing English FTS5 index, returns at most 20 distinct items with excerpts up to 1,200 characters, and accepts since and an exact feed URL or rss/web source type. Item IDs are SQLite entry IDs and may disappear under retention. Queries run on a read-only connection in a worker with a five-second deadline. Existing hybrid search remains available separately. See research skill.
  • Research integration status: The read-only contract uses the existing uncompressed cache. The planned gzip migration, rollback verification, and live LM Studio tool-session verification remain outstanding; see the integration plan.
  • Full Article Reader: get_rss_article returns a cached article's complete text and metadata given an entryId or canonical url, with offset/maxChars paging (default 12,000 chars) and an optional chunk layout (includeChunks: true) β€” so the model can read past the 600-character search snippet.
  • Ranking Debug: admin_rss_cache with action: "debug_search" (or the granular search_rss_cache_debug) explains each result β€” per-list rank, RRF contribution, cosine similarity, fused score β€” for observability without changing behaviour.
  • Eval Harness: npm run eval indexes a frozen corpus against a deterministic fake embedding server and reports recall@1/3/5/10, MRR, nDCG@10, and latency p50/p95, gating on regressions versus a committed baseline.
  • Structure-Aware Chunking: Text is split on paragraph and sentence boundaries (with a small overlap) instead of a fixed character window, so chunks never cut a sentence in half and embeddings represent coherent passages.
  • Content-Change Re-Indexing: Each entry stores a content hash; when a feed edits an article (same GUID, new body), the entry's chunks are rebuilt and re-embedded instead of being ignored forever.
  • Robust Article Extraction: Reads <article> / content selectors, strips boilerplate, preserves paragraph breaks and heading structure, and falls back to Open Graph / meta descriptions.
  • Rich Atom Content: Atom XHTML summaries and articles retain their text order and headings. Script, style, template, and noscript bodies are excluded from extracted text. Existing cached articles are updated when their feeds are refreshed and the content changes.
  • Self-Healing Embeddings: A bounded backfill runs once the model is detected at startup and after every refresh, so gaps from an offline model repair themselves. Embedding batches run with bounded concurrency and repeated queries are cached.
  • Per-Feed Configuration (feeds.json): Optionally override enabled, tags, scrapeFullText, linkPatterns, maxItems, and request headers for individual feeds; tags become a search filter.
  • Near-Duplicate Collapse (64-bit SimHash): Each entry stores a 64-bit SimHash over 3-gram word shingles (FNV-1a); syndicated articles that differ only in a footer or byline collapse to a single result, while genuinely distinct short updates are left uncollapsed.
  • Rich Search Controls: Filter by days/after/before, feed, author, tag, collection, or starred; sort by relevance or date; paginate with limit/offset. Filters are applied before ranking, not after.
  • Local Web Search (SearXNG, opt-in): Point searxngBaseUrl at a local SearXNG instance to create query feeds (a saved query rendered as <base>/search?q=…&format=rss), discover RSS feeds for a topic, and optionally backfill interesting results from the web into the cache as short-retention web entries. When webFallback is on, a search that returns nothing also runs a lightweight SearXNG digest (title + URL + snippet only, nothing indexed) so the model isn't left empty-handed.
  • Reader State & Saved Watches: Star or mark-read any article from chat (manage_rss_feeds with action: "set_state"), filter searches by starred, and save standing queries (admin_rss_cache with action: "watches") that are re-evaluated after every refresh β€” only articles published since the previous check are reported.
  • Optional Reranker Stage: With rerankDocs > 0, the top shortlist of a relevance-ordered search is re-ordered through LM Studio's /v1/rerank endpoint (e.g. a loaded bge-reranker model) before pagination. It silently degrades when the endpoint is absent, and probe results are cached with a failure cooldown so unconfigured setups pay nothing.
  • Diagnostics: cache_diagnostics (or admin_rss_cache with action: "diagnostics") reports coverage, sizes, feed health, and suggested fixes.
  • Structured Logs: Operational events are written as JSON lines to stderr. Set RSS_RAG_LOG_LEVEL to debug, info (default), warn, error, or silent; operation IDs distinguish concurrent runs and failure details are retained. Logs can contain feed URLs and error messages, so review them before sharing.
  • Feed Import/Export (OPML): Bring your subscriptions from another reader (manage_rss_feeds with action: "import_opml") or hand yours to it (action: "export_opml") β€” folders and categories survive the round trip, as do SearXNG query feeds.
  • Conditional Fetching: Background refreshes send If-None-Match / If-Modified-Since (ETag / Last-Modified) so unchanged feeds answer 304 Not Modified and cost almost no bandwidth. A manual refresh (or force: true) re-downloads everything.
  • Retry & Per-Feed Backoff: Requests retry on 429/5xx (and on a 403 that carries Retry-After) using the header (capped at 15s). Feeds that keep failing are placed in an exponential backoff (15 min doubling to 24 h) and skipped until their retry time, so one broken feed can't slow every refresh.
  • Embedding-Model Guard: The model ID and vector dimension are recorded with the cache. If you switch models, a dimension mismatch is detected and surfaced (instead of silently degrading search) and admin_rss_cache with action: "reembed" rebuilds the index.
  • Diversified, Recency-Aware Ranking: Results blend the fused relevance score with a gentle recency boost and pass through MMR (Maximal Marginal Relevance) so syndicated near-duplicate headlines don't crowd out distinct results. Snippets are windowed around the matching query terms.
  • Auto-HTML Scraper (Cheerio): If a URL doesn't have an RSS feed (like a standard news webpage), the plugin automatically scrapes the page for article links using configurable keywords (news, article, post, ...).
  • Smart Throttling (per host): Fetches RSS feeds concurrently across different domains, but never runs more than maxConcurrentPerHost requests at once against the same host and spaces them by minRequestGapMs + jitter (1.5–3 s by default). HTML pages are scraped one at a time, and robots.txt is respected before scraping or fetching full article text.
  • Ban Detection & Auto-Pause: Cloudflare / Akamai / Incapsula / captcha walls (including JS challenges served with HTTP 200) are recognised, logged as a loud ⚠️ BAN warning, and the offending host is paused (30 min, doubling to 12 h). Paused hosts appear as blockedHosts in the refresh result, so a block is never silent.
  • RSS/Atom XML via fast-xml-parser: Robust parsing of RSS 2.0 and Atom feeds, with a regex-based fallback parser for malformed XML.
  • Admin Tools (Opt-In): Feed add/remove/test/configure, pruning, reindexing, and VACUUM are available from chat through manage_rss_feeds and admin_rss_cache; the legacy granular tools remain available behind exposeGranularAdminTools.
  • Configurable Retention: Keeps entries by publish date (falling back to cache date) for 30, 60, 90, or 365 days.
  • Startup Model Check: Warns (non-fatally) if your configured embedding model isn't loaded, so you know why search drops to keyword-only.
  • Native SQLite Database: Uses Node.js's built-in node:sqlite module (WAL mode). No C++ addons or Visual Studio build tools required!
  • Versioned Migrations: The schema is upgraded through an idempotent PRAGMA user_version migration runner (currently version 14), so new columns/indexes and data upgrades (like the 64-bit SimHash backfill) are applied safely to existing databases.
  • Resilient Indexing: Articles and their chunks are embedded first and committed in a single transaction, so an interrupted or failed refresh never leaves half-indexed entries behind. Store-time L2 norms keep semantic search fast.
  • Automatic Maintenance: After each refresh the retention pass runs PRAGMA optimize and VACUUMs the database only when enough free pages have accumulated (so routine refreshes stay fast).
  • Safe Data Storage: Stores your feeds.txt and cache.db in ~/.lmstudio/plugin-data/rss-rag-cache/ so they survive plugin updates.

πŸ“‹ Requirements

  • LM Studio: Running the local server.
  • Embedding Model: You must download and load an embedding model in LM Studio (e.g., nomic-embed-text-v1.5) and start the local server on port 1234.
  • Node.js v22+: Requires Node version 22 or higher for native SQLite support.

πŸš€ Installation

  • Download or install this plugin directly from the LM Studio Plugin Hub.
  • Ensure LM Studio is running an embedding model on the Local Server.
  • The plugin will automatically create feeds.txt in your plugin-data folder on the first run.

βš™οΈ Configuration

1. Adding Feeds (feeds.txt)

Your feeds file is located at:

  • Windows: C:\Users\YOUR_USERNAME\.lmstudio\plugin-data\rss-rag-cache\feeds.txt
  • Mac/Linux: ~/.lmstudio/plugin-data/rss-rag-cache/feeds.txt

Add one RSS/Atom URL per line. You can also add standard webpage URLs (the plugin will scrape them automatically). Lines starting with # are ignored.

https://news.ycombinator.com/rss
https://www.theverge.com/rss/index.xml
# Non-RSS webpages (scraped automatically, slower):
https://example.com/news

2. Plugin Settings UI

Cache and indexing settings are global (they configure the shared on-disk cache). Only topK is per-chat, since it governs how much context a single conversation pulls in.

Global plugin settings:

SettingDefaultDescription
retentionDays90How long to keep articles (30, 60, 90, or 365 days).
refreshIntervalHours6How often the plugin automatically fetches new RSS items in the background.
embeddingModelnomic-embed-text-v1.5The exact model ID loaded in your LM Studio server.
chunkSize800Length (in characters) of each text chunk used for embedding and search.
embedBatchSize16How many chunks are sent to the embedding model per request (higher = faster but more VRAM).
embedConcurrency3How many embedding requests run in parallel during indexing/backfill.
maxConcurrentFeeds4How many RSS/Atom feeds are fetched at the same time (across all hosts).
maxConcurrentPerHost2Cap on simultaneous requests to any single domain. Low values keep anti-bot firewalls calm.
minRequestGapMs1500Minimum delay between two requests to the same host. Higher = safer, slower.
requestGapJitterMs1500Random extra delay added to each per-host gap so the crawl pattern is not perfectly regular.
respectRobotsTxtOnCheck robots.txt before scraping HTML pages or fetching full article text.
contactUserAgent(empty)Optional contact URL/email appended to the User-Agent so site owners can reach you instead of blocking you (e.g. https://example.com/bot).
semanticScanLimit50000Maximum chunks scanned per semantic search (higher = better recall, slower).
htmlLinkPatternsnews,article,post,blog,stories,pressComma-separated URL keywords used when scraping non-RSS pages.
contextualChunksOnEmbed each chunk as title | section breadcrumb + text so vectors are self-contained (improves recall on summary-only feeds). Changing it re-embeds the cache; older embed styles upgrade lazily.
contextChunks1How many adjacent chunks to include around each match (0–2) for extra context.
refreshOnStartupOnAutomatically fetch feeds when the plugin loads.
lmStudioBaseUrlhttp://localhost:1234Where the embedding model is served.
searxngBaseUrl(empty)Base URL of a local SearXNG instance (e.g. http://localhost:8888). Enables query feeds, feed discovery, web backfill and the webFallback digest.
webFallbackOffWhen a search finds nothing and SearXNG is configured, run a lightweight web-search digest (titles/URLs/snippets only, nothing indexed) instead of returning empty.
webSourceRetentionDays14How long entries backfilled from the web (source_type = web) stay in the cache before the retention pass expires them.
rerankDocs0Opt-in reranker shortlist size (e.g. 32). When 0 the rerank stage is skipped entirely; when set, relevance-ordered searches re-order their top candidates via /v1/rerank and silently degrade if the endpoint is absent.
enableAdminToolsOffRegisters the multiplexed admin_rss_cache tool (diagnostics, optimize, prune, reindex, reembed, debug search, web backfill, watches).
exposeGranularAdminToolsOffRegisters the legacy one-purpose tools (refresh_rss_feeds, list_rss_feeds, add_rss_feed, …) in addition to admin_rss_cache.

Per-chat settings:

SettingDefaultDescription
topK8How many unique articles to return per search.

3. Per-Feed Options (feeds.json)

For fine-grained control, create feeds.json next to feeds.txt (or use the set_feed_options tool). Feeds listed in feeds.txt are merged with their JSON overrides:

{
  "feeds": [
    { "url": "https://news.ycombinator.com/rss", "tags": ["tech", "startups"], "maxItems": 50 },
    { "url": "https://example.com/private.xml", "headers": { "Authorization": "Bearer ..." } },
    { "url": "https://example.com/news", "enabled": false }
  ]
}

Supported fields per feed: enabled, tags, scrapeFullText, linkPatterns, maxItems, headers, retentionDays, collection, refreshHours. Set enabled: false to keep a feed configured but skip fetching it, and use tags and collection to filter searches.

  • refreshHours β€” per-feed refresh interval (minimum 1 h). On background refreshes a feed is skipped until its interval has elapsed since its last successful fetch (manual refreshes with force: true always fetch). Feeds without the field refresh on every background run, as before.
  • SearXNG query feeds β€” manage_rss_feeds with action: "add" and a query (instead of/in addition to url) stores a rendered <base>/search?q=…&format=rss URL in feeds.txt plus a { "type": "searxng-query", "query": "…", "categories": "…" } note in feeds.json, so the query runs against SearXNG on every refresh. Requires a configured searxngBaseUrl.

πŸ› οΈ LM Studio Tools

The default surface has seven tools: four RSS tools and three read-only research tools.

Default tools (always registered)

  • cache_info, search_cache, get_cached_item β€” Version 1.0 research interface described above. Search and item retrieval only read the local cache and do not initiate refreshes.

  • search_rss_cache β€” Hybrid (BM25 keyword + semantic) search. Filter by days, after/before (ISO date), feed (URL substring), author, tag, collection, or starred; sort by relevance (default) or date; paginate with limit/offset. Filters are resolved to an entry-ID allow-list before ranking, results are recency-weighted, de-duplicated (SimHash), diversified (MMR), and β€” when rerankDocs > 0 and the LM Studio server exposes /v1/rerank β€” re-ordered by the reranker. Each hit includes expanded context (via contextChunks) and a snippet windowed around the matching query terms. When configured with SearXNG (searxngBaseUrl) and webFallback is on, an empty result set additionally includes a lightweight web-search digest that suggests running manage_rss_feeds / admin_rss_cache backfill to bring those pages into the cache.

  • get_rss_article β€” Full article reader: returns the complete stored text and metadata (title, link, feed, author, date, tags, collection, sourceType, starred, read, totalChars) for a cached article given an entryId or a url. Page through long articles with offset / maxChars (default 12,000, capped at 50,000) β€” the response reports hasMore / nextOffset β€” and pass includeChunks: true to also get the chunk layout with each chunk's embed style.

  • get_recent_cache_articles β€” Returns the most recent cached articles. Use this to see what news is available without guessing keywords.

  • manage_rss_feeds β€” One tool for every feed operation via action: list (feeds with tags/enabled state, per-feed health β€” last status, failure count, next retry β€” cache stats, the last refresh report, and a web-entry count when SearXNG backfill is used), add (auto-discovers <link rel="alternate"> feeds from homepages, accepts SearXNG query feeds, and takes per-feed options), remove, test, configure (per-feed feeds.json overrides, incl. refreshHours), discover (find RSS/feed candidates for a topic via SearXNG or for a homepage's alternate links), set_state (star/unstar or mark read/unread: id, starred, read), import_opml (bulk-add feeds from an OPML document, optional collection and dryRun), export_opml (emits the current feed list as OPML grouped by collection), and refresh (pass force: true to re-download everything and ignore backoff).

Optional: enableAdminTools

  • admin_rss_cache β€” Cache administration multiplexer via action: diagnostics (entry/chunk counts, embedding coverage and gaps, DB/WAL size, resident vector-index stats, feed backoff state, embedding model/dimension, schema version, starred/watch/web-entry counts, suggested actions), optimize (WAL checkpoint, VACUUM, ANALYZE), prune (delete cached articles of feeds no longer configured; web-backfilled entries are kept until they expire by webSourceRetentionDays), reindex (embed chunks stored text-only while the model was offline), reembed (rebuild the vector index with the current model; optional rechunk: true also re-chunks), debug_search (the search pipeline with per-result ranking details: per-list ranks, RRF contribution, cosine similarity, fused score), backfill_web (run a SearXNG web search and index the extractable results as short-retention web entries: query, limit, maxPerHost), and watches (saved-watch CRUD + evaluation via subaction: list, add (name, query, optional saved filters), remove (id), run β€” returns hits per watch).

Optional: exposeGranularAdminTools (adds admin_rss_cache plus the legacy one-purpose tools)

  • refresh_rss_feeds β€” Refreshes all feeds listed in feeds.txt, indexes new items, generates embeddings, and applies the retention policy. Feeds are fetched conditionally (ETag / Last-Modified) and failing feeds back off; pass force: true to re-download everything and ignore backoff. Returns a report of successes, not-modified, skipped, and failed feeds.
  • list_rss_feeds β€” Lists configured feeds (with their tags/enabled state) plus cache stats: entry/chunk counts, missing embeddings, DB size, the embedding model/dimension the cache was built with, per-feed health (last status, failure count, next retry), and the last refresh report.
  • add_rss_feed β€” Adds an RSS/Atom feed URL or webpage URL to feeds.txt. If a homepage is given, it auto-discovers the alternate feed via <link rel="alternate"> and adds the discovered feed URL instead (returns requestedUrl, discoveredFeedUrl, type, and any candidates).
  • remove_rss_feed β€” Removes a feed URL from feeds.txt (and any feeds.json override). Cached articles are kept until pruned.
  • set_feed_options β€” Sets per-feed options in feeds.json (enabled, tags, scrapeFullText, linkPatterns, maxItems, headers, retentionDays, collection). Only the supplied fields change.
  • test_feed β€” Checks whether a URL is a working RSS/Atom feed or scrapeable HTML page, and how many items it exposes. When the URL is an HTML page, it also returns a discovered object listing any alternate feeds found.
  • prune_removed_feeds β€” Deletes cached articles whose source feed is no longer in feeds.txt.
  • reindex_missing_embeddings β€” Re-embeds chunks stored as text-only while the embedding model was offline, and re-chunks any entries that ended up with no chunks. Also lazily upgrades older embed styles.
  • reembed_all β€” Rebuilds the entire vector index with the currently configured embedding model. Use after switching embedding models (or when a dimension-mismatch warning appears). Optional rechunk: true also re-chunks with the current chunkSize.
  • optimize_rss_cache β€” Runs a WAL checkpoint, VACUUM, and ANALYZE to reclaim disk space (e.g. after retention deletes) and refresh query statistics. A lighter version of this (PRAGMA optimize, and VACUUM when enough free pages accumulate) now runs automatically after each refresh.
  • search_rss_cache_debug β€” Diagnostic version of search_rss_cache that returns per-result ranking details (_debug) including per-list ranks, RRF contribution, cosine similarity, and the fused combined score. No behaviour change to the non-debug search.
  • cache_diagnostics β€” Reports cache health in one call: entry/chunk counts, embedding coverage and gaps, DB/WAL size, feed backoff state, embedding model/dimension, schema version, and suggested next actions.

πŸ§ͺ Development

npm install
npm test          # node:test suite (lib modules + a fake embedding server)
npm run typecheck # tsc --noEmit over src/*.ts
npm run eval      # Phase 0 retrieval eval (recall@k/MRR/nDCG@10 + latency)

Contributor notes:

  • Do not add "type": "module" to package.json. LM Studio bundles the plugin to a CommonJS .lmstudio/dev.js; marking the package as ESM would make Node load that bundle as ESM and break its require() calls.
  • Tests rely on Node's automatic module-syntax detection for the ESM lib/*.js files (Node 22.7+).
  • Set RSS_RAG_DATA_DIR to relocate the data directory. The test suite uses it to run against a throwaway SQLite database.
  • The registered tool list is decided by lib/toolSurface.js (resolveToolSurface); keep it in sync with the toolsMap in src/toolsProvider.ts.

🧠 How It Works

  • Fetch & Parse: The plugin pulls XML data from your URLs, parsing RSS 2.0 and Atom via fast-xml-parser (with a legacy regex fallback). If a URL returns HTML, it uses Cheerio to scrape the page for article links.
  • Throttling, Conditional GET & Backoff: RSS feeds are fetched concurrently (up to maxConcurrentFeeds overall, and at most maxConcurrentPerHost per domain) with If-None-Match / If-Modified-Since, so unchanged feeds return 304 and send no body. Consecutive requests to the same host are spaced by minRequestGapMs + random jitter (default 1.5–3 s), so a burst never looks like a scraper. HTML pages are fetched one-by-one and, because the pacing is per host, pages on different domains no longer wait on each other. 429 is retried with backoff (honouring Retry-After); a hard 403 is not retried (re-requesting a block is what turns a soft challenge into a permanent ban) unless it carries Retry-After. A feed that keeps failing enters exponential backoff (15 min β†’ 24 h) so it is skipped until its retry time.
  • Chunking: Article content is split on paragraph and sentence boundaries into ~800-character passages (with a small overlap), so chunks are coherent and never cut a sentence in half. Headings (h1–h3, preserved as Markdown) give each chunk a section breadcrumb β€” the heading path active where the chunk ends.
  • Embedding: Chunks are embedded as title | breadcrumb + body (contextual-v2) and sent to LM Studio's /v1/embeddings endpoint in batches, with bounded request concurrency and model-aware document/query prefixes. If the model is offline, chunks are stored text-only and a backfill (admin_rss_cache β†’ reindex, or automatically once the model is up) completes them later; caches built with older embed styles are upgraded the same way. Repeated search queries reuse a cached (prefixed) query embedding.
  • Storage: Text, metadata, content hashes, 64-bit SimHash fingerprints, and vector embeddings (stored as BLOBs) are saved in a WAL-mode SQLite file (cache.db) through a versioned migration runner (schema version 14). Newer items list first; retention purges by publish or cache date. When an existing entry's text changes, its chunks are transparently rebuilt.
  • Retrieval: Search filters first resolve to an entry-ID allow-list; the plugin then fuses a trigram FTS5 list, a porter BM25 FTS5 list, and a bounded cosine-similarity scan β€” all restricted to those entries β€” using Reciprocal Rank Fusion, deduplicates by article (collapsing syndicated duplicates via SimHash), blends in a gentle recency boost, and diversifies with MMR before returning results. Each result includes a snippet windowed around the matching query terms; the resident vector index is updated in place as articles are added or removed.
  • Health, Bans & Maintenance: Per-feed HTTP validators and failure state live in a feeds_state table, and per-host ban state lives in host_state. When a site blocks the crawler (HTTP 403/429, a Cloudflare/Akamai/Incapsula challenge, or a JS wall served with 200), the plugin logs a loud ⚠️ BAN warning, pauses the whole host (30 min, doubling to 12 h) so every feed on that domain stays quiet, and skips it on later refreshes until the backoff expires. The active list of paused hosts is returned by refresh_rss_feeds as blockedHosts (with a banWarning summary) and is stored in feeds_state/host_state so it survives restarts. The retention pass keeps planner statistics fresh and vacuums only when warranted; admin_rss_cache (or cache_diagnostics) summarizes coverage, sizes, feed health, and suggested fixes in one call.

πŸ› Troubleshooting

Search returns 0 matches Ensure your embedding model is loaded and the server is running. If the model is offline, the plugin falls back to keyword search β€” but if your articles don't contain the exact keywords, they won't be found. Run manage_rss_feeds with action: "list" to check that chunks > 0; with enableAdminTools on, admin_rss_cache with action: "reindex" fills the gaps once the model is loaded.

HTTP 403 Forbidden on a feed Some websites block automated requests. The plugin uses a Chrome User-Agent, robots.txt, per-host throttling, and never retries a hard 403 β€” but strict firewalls might still block it. When that happens the host is paused automatically and a ⚠️ BAN warning names it, with the paused hosts listed under blockedHosts in the refresh result. If you control the site, set contactUserAgent so they can whitelist you; otherwise use an alternative RSS URL or an RSS Bridge service.

HTTP 429 Too Many Requests Sites like Reddit aggressively block Node.js fetch requests. If this happens, use an RSS Bridge URL (e.g., https://rss-bridge.org/bridge01/?action=display&bridge=RedditBridge&format=Atom) instead of the native .rss link.

I changed the embedding model and search got worse Vectors from different models aren't comparable. The plugin logs a dimension-mismatch / model-change warning and manage_rss_feeds (action: "list") shows the model and dimension the cache was built with. Run admin_rss_cache with action: "reembed" (enable enableAdminTools, or use reembed_all when granular tools are exposed) with the new model loaded to rebuild the index.

A feed keeps failing Repeated failures trigger exponential backoff (15 min β†’ 24 h); manage_rss_feeds with action: "list" shows each feed's failure count and next retry time. Fix the URL, or run manage_rss_feeds with action: "refresh" and force: true to retry immediately.

πŸ“¦ Changelog

1.6.0

  • Local SearXNG integration (all opt-in behind searxngBaseUrl): query feeds β€” save a search as a feed (manage_rss_feeds with action: "add" and query) that runs against SearXNG's RSS format on every refresh; feed discovery (action: "discover") finds RSS candidates for a topic; web backfill (admin_rss_cache with action: "backfill_web") fetches the extractable pages behind search results and indexes them as short-retention web entries (guid = web:<url>, source_type = web), exempt from feed-list pruning and expiring after webSourceRetentionDays (default 14); empty-search web fallback (webFallback, off by default) returns a token-cheap web digest (titles + URLs + snippets) instead of nothing. SearXNG never needs the (usually admin-gated) JSON format: query feeds use the standard format=rss rendering.
  • OPML import/export: manage_rss_feeds with action: "import_opml" bulk-adds subscriptions from an OPML document (folders/categories become tags; collection and dryRun options), and action: "export_opml" emits the feed list grouped by collection β€” SearXNG query feeds round-trip as well.
  • Reader state: entries gain starred and is_read columns (migrations 12–13); manage_rss_feeds with action: "set_state" toggles them from chat, search_rss_cache gains a starred filter, and get_rss_article returns the flags.
  • Saved watches (migration 14, watches table): standing queries (admin_rss_cache with action: "watches", subaction: list|add|remove|run) are evaluated after every refresh and report only articles published since the previous run (30-day look-back on first run; the window advances even when nothing matches).
  • Per-feed refresh intervals: refreshHours in feeds.json (via configure) skips a feed on background refreshes until its interval has elapsed; force: true bypasses. A global last_refresh marker is updated per run.
  • Optional reranker: rerankDocs (default 0 = off) re-orders the top shortlist of relevance-ordered searches via LM Studio's /v1/rerank; the probe result is cached for the process lifetime (failures cool down 10 min) and the stage silently degrades when the endpoint is absent.
  • New modules lib/searxng.js, lib/opml.js, lib/watches.js, lib/rerank.js; diagnostics gain starred/watch/web-entry counts; retrieval results now include entry_id, source_type, and starred.
  • Test suite grown to 96 tests (searxng, OPML, watches, reader state, per-feed intervals, rerank against a fake LM Studio server).

1.5.0

  • Anti-ban crawl policy. Per-host request pacing: at most maxConcurrentPerHost requests in flight against any single domain, spaced by minRequestGapMs + requestGapJitterMs (default 1.5–3 s). Pages on different hosts no longer wait on each other, so wide fans-out stay fast while any one domain stays polite. New settings: maxConcurrentPerHost, minRequestGapMs, requestGapJitterMs, respectRobotsTxt, contactUserAgent; maxConcurrentFeeds default lowered 8 β†’ 4.
  • A hard 403 is no longer retried (only a 403 carrying Retry-After), since re-requesting a block is what escalates a soft challenge into a permanent ban. 429/5xx retry behaviour is unchanged.
  • robots.txt is honoured before scraping HTML pages and before fetching full article text (never for RSS feed URLs, which are published for machines). Missing/unreadable robots.txt means "allowed", as every major crawler assumes.
  • Ban detection for Cloudflare, Akamai, Incapsula, Sucuri, DataDome, PerimeterX and generic captcha walls β€” including JS challenges served with HTTP 200 β€” plus vendor identification from response headers.
  • Ban logging and auto-pause: a detected block logs a loud ⚠️ BAN warning naming the host, modal challenge, and attempt count; the whole host is then paused (30 min, doubling to 12 h) and skipped on subsequent refreshes. New host_state table (schema version 11) persists this across restarts, and the active pause list is returned as blockedHosts (with a banWarning summary) by refresh_rss_feeds, so a block is never silent. A host that answers normally again clears its own ban record.
  • New modules: lib/rateLimiter.js (per-host limiter), lib/robots.js (robots.txt parser + cache), lib/bans.js (bot-wall classification); new tests for all three plus test/fetcher.test.js covering no-retry-on-403, 429 retry, host backoff skips, robots vetoes, and cross-host pacing.

1.4.0

  • Pre-filtered hybrid retrieval: search filters resolve to an entry-ID allow-list first, and both FTS5 keyword lists and the vector scan (resident and streaming) only score in-scope articles β€” filtered searches scale with match count instead of cache size.
  • Asymmetric embedding prefixes + heading breadcrumbs (embed style contextual-v2): chunks embed as title | section breadcrumb + body, queries/documents receive model-specific prefixes (search_query:/search_document: for nomic, Represent this sentence… for bge/mxbai/snowflake), and <h1>–<h3> are preserved as Markdown so each chunk knows its section. Older embed styles upgrade lazily (migrations 9–10; schema version 10).
  • Agent-optimized tool surface: the default is 4 core tools (search_rss_cache, get_rss_article, get_recent_cache_articles, manage_rss_feeds). New full-article reader get_rss_article (by entry ID or URL, offset/maxChars paging, optional chunk layout), new multiplexed manage_rss_feeds (list/add/remove/test/configure/refresh), and new admin_rss_cache (diagnostics/optimize/prune/reindex/reembed/debug_search). enableAdminTools and exposeGranularAdminTools opt back into the admin and granular tools.
  • Incremental in-memory vector index: appended chunks and removed articles update the resident matrix in place (tombstones + O(1) free list) instead of triggering a full rebuild, with vectorIndexStats() reporting live/tombstone/capacity counts.
  • 64-bit SimHash: FNV-1a over 3-gram word shingles replaces the 32-bit hash with a ≀4-bit Hamming threshold, so syndicated articles with footer drift collapse while distinct short posts don't; legacy 32-bit fingerprints are backfilled on migration.
  • Retrieval eval re-baselined after these changes (no regressions); new tests for the tool surface, prefix routing, chunking/breadcrumbs, the incremental index, and SimHash dedupe.

1.3.0

  • Contextual chunk embeddings (prefix title to chunk before embedding) and background upgrade of stale chunks via reindex_missing_embeddings.
  • Small-to-big context: each hit expands to neighbouring chunks (configurable via contextChunks).
  • In-memory vector index: pre-normalised flat Float32Array with lazy rebuilds, zero per-query allocations, and a memory ceiling (RSS_RAG_INDEX_MAX_MB) falling back to the streaming SQL scan.
  • Feed auto-discovery: add_rss_feed discovers <link rel="alternate"> feeds from blog homepages; test_feed reports discovered alternates.
  • Per-feed TTL overrides and collection labels (feeds.json), with retention honouring overrides and search supporting a collection filter.
  • search_rss_cache_debug tool for ranking introspection; cache_diagnostics reports vector-index and embed-style coverage.
  • Phase 0 eval harness (lib/eval.js, npm run eval, frozen corpus, deterministic baseline) for recall@1/3/5/10, MRR, nDCG@10, and latency.

1.2.0

  • Hybrid retrieval rewritten around Reciprocal Rank Fusion of a trigram FTS5 list, a new porter unicode61 BM25 FTS5 list, and a bounded vector scan.
  • Structure-aware, sentence-boundary chunking with overlap (replaces fixed-window slicing).
  • Content-change re-indexing: entries store a content hash, so edited articles (same GUID) are re-chunked and re-embedded.
  • Improved article extraction (content selectors, boilerplate stripping, paragraph preservation, Open Graph fallback).
  • Self-healing embeddings: bounded backfill at startup and after each refresh, bounded-concurrency embedding batches, and a query-embedding cache.
  • Per-feed configuration via feeds.json (enabled, tags, scrapeFullText, linkPatterns, maxItems, headers) and a new set_feed_options tool.
  • SimHash near-duplicate collapse for syndicated articles.
  • Search filters (days/after/before, feed, author, tag), relevance/date sorting, and limit/offset pagination.
  • New cache_diagnostics tool and a versioned PRAGMA user_version migration runner.
  • Added a GitHub Actions CI workflow (typecheck + tests) and expanded the test suite to 18 tests.

1.1.0

  • Conditional HTTP fetching (If-None-Match / If-Modified-Since) with per-feed exponential backoff, backed by a new feeds_state table.
  • Embedding model/dimension tracking: mismatches are detected and warned about instead of silently degrading search; new reembed_all tool rebuilds the index after a model change.
  • Retrieval quality: gentle recency blending, MMR diversity, and snippets windowed around the matching query terms.
  • Automatic maintenance after each refresh (PRAGMA optimize, plus VACUUM only when enough free pages accumulate).
  • refresh_rss_feeds accepts a force flag; list_rss_feeds reports per-feed health and the model/dimension the cache was built with.
  • Expanded the test suite (conditional GET/304/backoff, reembedAll, ranking) and added a npm run typecheck script.

1.0.0

  • Initial public release.

1.6.1

  • Structured JSON Lines logging: one machine-readable event per line emitted to stderr with fields for UTC timestamp, severity, component, event name, operation ID (correlating all events from a single search/refresh/job), duration, outcome, attempt number, error code/retryability/explanation, plugin version, config ID, and index ID. Levelled (debug/info/warn/error) with suppression of repetitive events. Never throws on failure. Privacy-safe: omits raw queries, article text, embedding vectors, auth headers, cookies, URL query strings from routine logs.
  • Quality monitoring dashboard: operational indicators (empty-result rate, degraded-search rate, embedding coverage, indexing backlog, feed freshness, extraction success rate, duplicate-collapse rate, source diversity, full-text vs summary coverage, result age distribution, watch processing lag, p50/p95 latency, error rates β€” all with denominators and time windows, with "insufficient data" markers). Measured retrieval quality (recall@k, MRR, nDCG against labelled queries, kept separate from operational signals). No probability claims on scores. Configurable thresholds and cooldowns for local warnings. State-transition logging to prevent repetitive alerts. Local-only β€” no external telemetry.
  • Enhanced diagnostics: cache_diagnostics now includes p50/p95 latency percentiles, error rates, embedding coverage gap reasons, indexing backlog fraction, feed freshness (hours since last fetch), extraction success rate, and source diversity. Separate operational-indicator and measured-quality sections.
  • Operation-ID correlation: every search, refresh, and fetch cycle carries an operationId field that threads through all sub-events (visible in structured log output). Enables root-cause tracing across fetch β†’ embed β†’ index β†’ retrieve pipeline.
  • Centralized logger in lib/log.js with createLogger(scope) per module, and log as the backward-compatible default. Bounded JSON Lines output to process.stderr with a pretty-console fallback. Configurable via RSS_RAG_LOG_LEVEL (debug | info | warn | error | silent).
  • New settings awareness: configId() and indexId() compact hashes of effective settings and current embedding model/dimension, emitted on every relevant event for deploy-stability tracking.
  • 1.6.2 - Fixed build failure: removed invalid float: true property from createConfigSchematics() field definitions for mmrLambda and recencyBlend in src/config.ts, which caused esbuild to exit with code 1. TypeScript typecheck now passes; plugin loads and eval tests pass without modification to external dependencies or service contacts.

1.6.0

  • Local SearXNG integration (all opt-in behind searxngBaseUrl): query feeds β€” save a search as a feed (manage_rss_feeds with action: "add" and query) that runs against SearXNG's RSS format on every refresh; feed discovery (action: "discover") finds RSS candidates for a topic; web backfill (admin_rss_cache with action: "backfill_web") fetches the extractable pages behind search results and indexes them as short-retention web entries (guid = web:<url>, source_type = web), exempt from feed-list pruning and expiring after webSourceRetentionDays (default 14); empty-search web fallback (webFallback, off by default) returns a token-cheap web digest (titles + URLs + snippets) instead of nothing. SearXNG never needs the (usually admin-gated) JSON format: query feeds use the standard format=rss rendering.
  • OPML import/export: manage_rss_feeds with action: "import_opml" bulk-adds subscriptions from an OPML document (folders/categories become tags; collection and dryRun options), and action: "export_opml" emits the feed list grouped by collection β€” SearXNG query feeds round-trip as well.
  • Reader state: entries gain starred and is_read columns (migrations 12–13); manage_rss_feeds with action: "set_state" toggles them from chat, search_rss_cache gains a starred filter, and get_rss_article returns the flags.
  • Saved watches (migration 14, watches table): standing queries (admin_rss_cache with action: "watches", subaction: list|add|remove|run) are evaluated after every refresh and report only articles published since the previous run (30-day look-back on first run; the window advances even when nothing matches).
  • Per-feed refresh intervals: refreshHours in feeds.json (via configure) skips a feed on background refreshes until its interval has elapsed; force: true bypasses. A global last_refresh marker is updated per run.
  • Optional reranker: rerankDocs (default 0 = off) re-orders the top shortlist of relevance-ordered searches via LM Studio's /v1/rerank; the probe result is cached for the process lifetime (failures cool down 10 min) and the stage silently degrades when the endpoint is absent.
  • New modules lib/searxng.js, lib/opml.js, lib/watches.js, lib/rerank.js; diagnostics gain starred/watch/web-entry counts; retrieval results now include entry_id, source_type, and starred.
  • Test suite grown to 96 tests (searxng, OPML, watches, reader state, per-feed intervals, rerank against a fake LM Studio server).