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

rag-mcp

v1.2.11

Published

Godspeed RAG agent

Readme

Godspeed RAG Chatbot

A Retrieval-Augmented Generation (RAG) chatbot built using the Godspeed Framework, designed to intelligently respond to queries using the latest Godspeed Systems documentation. It leverages embeddings and a local FAISS vector database to deliver fast, relevant, and source-traceable answers.


Key Features

1. Query Handling via mcp.handle-query Tool

  • Purpose: Core component responsible for receiving user queries and returning relevant context and sources.
  • How it Works:
    • Hosted on stdio and automatically connected to the Saarthi assistant.
    • When the "Godspeed Mode" is activated in Saarthi, user queries are forwarded to this tool.
    • The tool searches the FAISS vector store for relevant content and returns:
      • Extracted context
      • Source document paths

2. GitHub Documentation Ingestion

  • Source: Godspeed Documentation GitHub Repo
  • How it Works:
    • Repo URL and branch are configured.
    • The ingestion script checks for diffs via GitHub API and SHA hash comparison to determine modified files.
    • New or modified files are chunked and embedded using a Google Gemini embedding model, then upserted into FAISS.

3. FAISS Vector Store (Local)

  • Why FAISS:
    • FAISS is fast and efficient, particularly with local storage.
    • Minimizes latency compared to remote vector databases.
  • Operations:
    • Upsert, search, delete vectors
    • Stores document path as doc_id for efficient tracking of file changes

4. User Query HTTP Endpoint

  • Accepts user queries via HTTP and returns context and results in real-time.
  • Useful for testing or integrating the chatbot into frontend applications.

5. Document Upload HTTP Endpoint

  • Accepts raw documentation files for ingestion.
  • Uses SHA comparison to avoid redundant vector operations.

6. LLM Configuration HTTP Endpoint

  • Allows dynamic configuration of embedding/LLM keys for better modularity.
  • Currently supports Google Gemini Embeddings.

7. Cron Job for Repo Sync

  • Frequency: Checks every minute.
  • Sync Trigger: Detects if 24 hours have passed since the last update.
  • Action: If a day has passed, it re-fetches GitHub data and re-ingests changed files.

8. API Key Management via mcp.handle-api-key

  • Integration: API key input can be done via Saarthi through the MCP layer.
  • Ensures secure and flexible key injection for embedding models.

🧱 Architecture

                          ┌────────────┐
                          │   Saarthi  │
                          └─────┬──────┘
                                │
                                ▼
                      ┌────────────────────┐
                      │ mcp.handle-query   │◄────┐
                      └────────┬───────────┘     │
                               │                 │
          ┌────────────────────▼────────────┐    │
          │  FAISS Vector Store (Local)     │    │
          └─────────────────────────────────┘    │
                               ▲                 │
        ┌──────────────────────┴────────────┐    │
        │ ingest_and_update_docs.ts         │◄───┘
        └────────────────┬──────────────────┘
                         │
       ┌─────────────────▼───────────────────────┐
       │ GitHub Repo: gs-documentation           │
       └─────────────────────────────────────────┘

🚀 Running the Project

Clean Start (Windows)

start_clean.bat

Clean Start (Linux/macOS)

./start_clean.sh

Both scripts:

  • Kill any process on port 10947
  • Run godspeed serve to start the backend

Limitations

Embedding Model Limitation

  • Currently supports only Google Gemini Embeddings
  • Other models like OpenAI, Cohere, etc., are not yet integrated

Local FAISS Index

  • Pros: Fast and efficient
  • Cons: Not scalable for distributed or cloud-native architectures

Single Documentation Source

  • Currently tied to a specific GitHub repo (gs-documentation)
  • No built-in support for multiple sources or domains

No GUI/Web Interface

  • Operates via CLI, MCP, or HTTP endpoints
  • No default front-end for interacting with the bot

🧪 Test Scenarios

  • Query handling through Saarthi and mcp.handle-query
  • Documentation updates via GitHub sync (cron job)
  • File-level change detection using SHA and GitHub diffs
  • Document ingestion through HTTP endpoint

🧩 Future Improvements

  • 🧠 Embedding model selection and modular configuration
  • 📊 Improve logging and usage analytics