groq-rag

Documentation

Welcome to the groq-rag documentation.

Guide Description
Getting Started Installation and first steps
API Reference Complete API documentation
Cookbook Real-world patterns and recipes
Examples Code examples for common use cases

What is groq-rag?

groq-rag extends the Groq SDK with three powerful capabilities:

┌─────────────────────────────────────────────────────────────┐
│                        groq-rag                             │
├─────────────────┬─────────────────┬─────────────────────────┤
│      RAG        │      Web        │        Agents           │
├─────────────────┼─────────────────┼─────────────────────────┤
│ • Add documents │ • Fetch URLs    │ • Autonomous reasoning  │
│ • Semantic      │ • Web search    │ • Tool use              │
│   search        │ • Parse HTML    │ • Multi-step tasks      │
│ • Context       │ • Markdown      │ • Streaming             │
│   retrieval     │   conversion    │ • Memory                │
└─────────────────┴─────────────────┴─────────────────────────┘

Choose Your Path

I want to…

Build a chatbot with my own dataRAG Guide

Search the web in real-timeWeb Search Guide

Create an AI that uses toolsAgent Guide

Understand the full APIAPI Reference

See working codeExamples

Architecture Overview

User Request
     │
     ▼
┌─────────────┐
│  GroqRAG    │ ◄── Main client
│   Client    │
└─────┬───────┘
      │
      ├──────────────┬──────────────┬──────────────┐
      ▼              ▼              ▼              ▼
┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐
│   Chat   │  │   RAG    │  │   Web    │  │  Agent   │
│  Module  │  │  Module  │  │  Module  │  │  System  │
└────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘
     │             │             │             │
     │        ┌────┴────┐   ┌────┴────┐   ┌────┴────┐
     │        ▼         ▼   ▼         ▼   ▼         │
     │   ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐│
     │   │Chunker │ │Vector  │ │Fetcher │ │ Tools  ││
     │   │        │ │Store   │ │        │ │        ││
     │   └────────┘ └────────┘ └────────┘ └────────┘│
     │        │         │          │          │     │
     └────────┴─────────┴──────────┴──────────┴─────┘
                              │
                              ▼
                        ┌──────────┐
                        │ Groq API │
                        └──────────┘

Installation

npm install groq-rag

Minimum Example

import GroqRAG from 'groq-rag';

const client = new GroqRAG();

// Simple chat
const response = await client.complete({
  model: 'llama-3.3-70b-versatile',
  messages: [{ role: 'user', content: 'Hello!' }]
});

console.log(response.choices[0].message.content);

Need Help?