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

@djangocfg/ext-knowbase

v1.0.7

Published

Knowledge base and chat extension for DjangoCFG

Readme

DjangoCFG Extension Preview

📦 View in Marketplace📖 Documentation⭐ GitHub

@djangocfg/ext-knowbase

Knowledge base and RAG-powered chat extension for DjangoCFG.

Part of DjangoCFG — modern Django framework for production-ready SaaS applications.

Features

  • 📚 Document Management - Upload, organize, and manage documentation
  • 💬 RAG-Powered Chat - AI chat with context from your documents
  • 📁 Archive Processing - Bulk upload and process ZIP archives
  • 🔍 Smart Search - Find information across all documents
  • 📊 Document Analytics - Track usage and engagement
  • 🔄 Auto-Processing - Automatic document parsing and indexing
  • 💾 Session Management - Persistent chat sessions

Install

pnpm add @djangocfg/ext-knowbase

Usage

Provider Setup

import { KnowbaseProvider } from '@djangocfg/ext-knowbase/hooks';

export default function RootLayout({ children }) {
  return (
    <KnowbaseProvider>
      {children}
    </KnowbaseProvider>
  );
}

Document Management

import {
  useKnowbaseDocumentsContext,
} from '@djangocfg/ext-knowbase/hooks';

function DocumentsPage() {
  const {
    documents,
    uploadDocument,
    deleteDocument,
    isLoadingDocuments,
  } = useKnowbaseDocumentsContext();

  const handleUpload = async (file: File) => {
    await uploadDocument({
      file,
      title: file.name,
      description: 'Uploaded document',
    });
  };

  return (
    <div>
      <input
        type="file"
        onChange={(e) => e.target.files && handleUpload(e.target.files[0])}
      />
      {documents.map(doc => (
        <div key={doc.id}>
          <h3>{doc.title}</h3>
          <p>Status: {doc.status}</p>
          <button onClick={() => deleteDocument(doc.id)}>Delete</button>
        </div>
      ))}
    </div>
  );
}

RAG-Powered Chat

import { useKnowbaseChatContext } from '@djangocfg/ext-knowbase/hooks';

function ChatInterface() {
  const { sendQuery, chatHistory, isLoading } = useKnowbaseChatContext();

  const handleSend = async (message: string) => {
    await sendQuery({
      query: message,
      session_id: sessionId,
    });
  };

  return (
    <div>
      {chatHistory.map((msg, idx) => (
        <div key={idx}>
          <strong>{msg.role}:</strong> {msg.content}
        </div>
      ))}
      <input
        onKeyDown={(e) => {
          if (e.key === 'Enter') {
            handleSend(e.currentTarget.value);
          }
        }}
        disabled={isLoading}
      />
    </div>
  );
}

Archive Processing

import { useKnowbaseDocumentsContext } from '@djangocfg/ext-knowbase/hooks';

function ArchiveUpload() {
  const { uploadArchive, getArchiveById } = useKnowbaseDocumentsContext();

  const handleArchiveUpload = async (file: File) => {
    const result = await uploadArchive({
      file,
      auto_process: true,
    });

    // Check processing status
    const archive = await getArchiveById(result.id);
    console.log('Processing status:', archive.processing_status);
  };

  return (
    <input
      type="file"
      accept=".zip"
      onChange={(e) => e.target.files && handleArchiveUpload(e.target.files[0])}
    />
  );
}

API Reference

Documents Context

  • documents - List of all documents
  • uploadDocument(data) - Upload single document
  • deleteDocument(id) - Delete document
  • updateDocument(id, data) - Update document metadata
  • getDocumentById(id) - Get document details
  • uploadArchive(data) - Upload ZIP archive
  • processArchive(id) - Trigger archive processing

Chat Context

  • sendQuery(data) - Send chat query to RAG system
  • chatHistory - Current chat session history
  • clearHistory() - Clear chat history
  • isLoading - Loading state

Sessions Context

  • sessions - List of chat sessions
  • createSession(data) - Create new session
  • deleteSession(id) - Delete session
  • getCurrentSession() - Get active session

License

MIT

Links