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

ragcy

v1.0.3

Published

Rag as a service - Ragcy

Readme

Ragcy

Ragcy is a Node.js client library for interacting with the Ragcy API. It provides an easy-to-use interface for managing corpora, data sources, sessions, and queries.

Installation

Install the package using npm:

npm install ragcy

Usage

First, import and initialize the Ragcy client. Get your API_KEY here

const ragcy = require('ragcy');

const client = ragcy.init({ key: 'YOUR_API_KEY' });

Corpus Management

Create a new corpus:

const newCorpus = await client.createCorpus('category', 'name', 'welcome message', 'agent instruction', 'prompt');

List all corpora:

const corpusList = await client.corpusList();

Update a corpus:

const updatedCorpus = await client.updateCorpus('corpusId', { name: 'New Name' });

Delete a corpus:

await client.deleteCorpus('corpusId');

Querying

Query a corpus:

const response = await client.query('corpusId', 'user input', 'sessionId');

Data Source Management

Add a data source:

// Add a file
const fileDataSource = await client.addDataSource('corpusId', '/path/to/file.pdf');

// Add a URL
const urlDataSource = await client.addDataSource('corpusId', null, 'https://example.com/data');

List data sources for a corpus:

const dataSources = await client.dataSourceList('corpusId');

Remove a data source:

await client.removeDataSource('dataSourceId');

Session Management

List sessions for a corpus:

const sessions = await client.sessionList('corpusId');

List requests for a session:

const requests = await client.requestList('sessionId');

Supported File Types

When adding file data sources, the following file extensions are supported:

  • json
  • xls
  • xlsx
  • mkv
  • mp4
  • mp3
  • wav
  • pdf
  • txt
  • csv
  • docx
  • doc

Error Handling

All methods return promises and throw errors for unsuccessful requests. It's recommended to use try-catch blocks or .catch() methods when calling these functions.

License

MIT License

This README provides an overview of the package, installation instructions, usage examples for each main function, information about supported file types, and a note on error handling. You may want to add more details, such as:

  1. A more detailed API reference
  2. Information about rate limiting
  3. Troubleshooting tips
  4. Contributing guidelines
  5. A changelog

Remember to create a LICENSE file if you haven't already, and consider adding more extensive documentation if the API has more complex features or options.