Skip to content
25 changes: 25 additions & 0 deletions demos/demos-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,28 @@ demos:
cpu: 6400m
memory: 12622Mi
pvc: 20Gi
opensearch-rag:
description: Retrieval Augmented Generation (RAG) demo with OpenSearch vector search and Llama 3.1 8B for semantic question answering
documentation: https://docs.stackable.tech/home/stable/demos/opensearch-rag
stackableStack: opensearch-rag
labels:
- opensearch
- rag
- vector-search
- ai
- llm
- llama
- ollama
- jupyterlab
- semantic-search
manifests:
- plainYaml: ./demos/opensearch-rag/load-embeddings-from-git.yaml
supportedNamespaces: []
resourceRequests:
cpu: 8000m
memory: 16Gi
pvc: 10Gi
parameters:
- name: branch
description: Git branch to download demo files from
default: main
55 changes: 55 additions & 0 deletions demos/opensearch-rag/embeddings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# OpenSearch RAG Demo - Embeddings Generation

This directory contains the script to regenerate embeddings for the Stackable documentation.

## Prerequisites

**Ollama with nomic-embed-text:v1.5 model** - Choose one of the following options:

### Option 1: Run Ollama locally

```bash
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull the embedding model
ollama pull nomic-embed-text:v1.5
```

### Option 2: Port-forward from the demo

```bash
# Deploy the demo if not already running
stackablectl demo install opensearch-rag

# Port-forward Ollama (keep running in a separate terminal)
kubectl port-forward deployment/ollama 11434:11434
```

## Regenerate Embeddings

Run the script using uv to automatically handle Python dependencies:

```bash
uv run --with requests --with beautifulsoup4 python generate-embeddings-local.py
```

This will:
- Crawl docs.stackable.tech (defaults to `stable` release)
- Extract and chunk documentation
- Generate embeddings using nomic-embed-text
- Save to `stackable-docs-embeddings.json` (~89 MB, ~4200 chunks)

The process can take more than 1 hour mainly depending on your CPU.

### Configuration

You can customize the crawling behavior with environment variables:

```bash
# Crawl a specific Stackable release (default: stable)
RELEASE=24.11 uv run --with requests --with beautifulsoup4 python generate-embeddings-local.py

# Crawl nightly documentation
RELEASE=nightly uv run --with requests --with beautifulsoup4 python generate-embeddings-local.py
```
Loading
Loading