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

rag-chat-ui

v0.0.3

Published

A lightweight **Angular chat component** for Retrieval-Augmented Generation (RAG). Drop it into any Angular app and point it at your backend’s `/api/ask` endpoint.

Readme

RagChat UI

A lightweight Angular chat component for Retrieval-Augmented Generation (RAG).
Drop it into any Angular app and point it at your backend’s /api/ask endpoint.

✅ No secrets in the UI
✅ Simple API contract (POST /ask{ answer, screenshots })
✅ Works with Angular modules or standalone apps


Installation

npm i rag-chat-ui

Peer requirements

Angular >= 15

@angular/forms

@angular/common

@angular/common/http

Quick Start
Using NgModule (classic)
// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { RagChatUiModule } from 'rag-chat-ui';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, HttpClientModule, FormsModule, RagChatUiModule],
  bootstrap: [AppComponent],
})
export class AppModule {}

<!-- app.component.html -->
<ragu-chat [apiBase]="'https://your-backend.example.com/api'"></ragu-chat>

Using Standalone Bootstrap (Angular 15+)
// main.ts
import { bootstrapApplication, importProvidersFrom } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { RagChatUiModule } from 'rag-chat-ui';
import { AppComponent } from './app/app.component';

bootstrapApplication(AppComponent, {
  providers: [importProvidersFrom(HttpClientModule, FormsModule, RagChatUiModule)],
});

Component
<ragu-chat [apiBase]="'/api'"></ragu-chat>

Inputs
Input	Type	Default	Description
apiBase	string	'/api'	Base URL of your backend (must expose /ask).

Backend Contract

Your backend should implement:

POST {apiBase}/ask

Request body

{ "query": "string" }

Response
{ "answer": "markdown or text", "screenshots": ["https://.../img1.png"] }

The component renders answer and shows each screenshot in a gallery row.

Styling

A clean default layout ships with the component.
Wrap it in a container to control width:
<div style="max-width: 720px; margin: 40px auto;">
  <ragu-chat [apiBase]="'/api'"></ragu-chat>
</div>

Example Backend

Minimal Express/TypeScript handler:
app.post('/api/ask', async (req, res) => {
  const q = String(req.body?.query || '');
  res.json({
    answer: `You asked: **${q}**`,
    screenshots: ['/static/screenshots/example.png'],
  });
});

Local Development (for the library)
# build the library
ng build rag-chat-ui

# preview what will be published
cd dist/rag-chat-ui
npm pack
tar -tf *.tgz   # list package contents

Security

Do not put API keys in frontend code.

Keep secrets in your backend (.env) and never publish them.

FAQ

Q: Does this include retrieval or LLM code?
A: No — this package is UI only. Point it at your own /api/ask.

Q: Can I customize the look?
A: Yes — wrap the component, override CSS globally, or fork the styles.

License

MIT ©ameyb - Amprine Solutions Inc.