Skip to content

Commit c90ba3d

Browse files
committed
Update documentation with simpler README and Docker setup guide
1 parent 312baa4 commit c90ba3d

File tree

2 files changed

+116
-20
lines changed

2 files changed

+116
-20
lines changed

supporting-blog-content/building-multimodal-rag-with-elasticsearch-gotham/README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,39 @@ The pipeline demonstrates how to:
1111

1212
## Prerequisites
1313

14-
- A Docker runtime with 8GB+ free ram
15-
- GPU is optional, but recommended
14+
- Python 3.x
1615
- Elasticsearch cluster (cloud or local)
1716
- OpenAI API key - Setup an OpenAI account and create a [secret key](https://platform.openai.com/docs/quickstart)
17+
- 8GB+ RAM
18+
- GPU (optional but recommended)
1819

19-
## Quick Start
20+
## Execution Options
2021

21-
This example runs four stages as docker compose services:
22+
This project can be run in two different ways:
2223

23-
```mermaid
24-
graph TD
25-
verify-file-structure --> generate-embeddings
26-
generate-embeddings --> index-content
27-
index-content --> search-and-analyze
28-
```
24+
### 1. Jupyter Notebook
2925

30-
First, copy [env.example](env.example) to `.env` and fill in values noted inside.
26+
We provide a Google Colab notebook that allows you to explore the entire pipeline interactively:
27+
- [Open the Multimodal RAG Pipeline Notebook](notebook/01-mmrag-blog-quick-start.ipynb)
28+
- This notebook includes step-by-step instructions and explanations for each stage of the pipeline
3129

32-
Now, enter below to run the pipeline:
33-
```bash
34-
docker compose run --build --rm search-and-analyze
35-
```
30+
### 2. Docker
3631

37-
The first time takes a while to build the image and download ImageBind weights.
32+
For containerized execution that ensures consistent environment:
33+
- Follow the [Docker Setup Guide](docker-setup.md) for instructions on running the pipeline using Docker Compose
34+
- This option handles all dependencies and environment setup automatically
35+
- Ideal for reproducible runs
3836

39-
If you want to re-run just one stage, add `--no-deps` like this:
40-
```bash
41-
docker compose run --no-deps --build --rm search-and-analyze
42-
```
4337

4438
## Project Structure
4539

4640
```
4741
├── README.md
4842
├── requirements.txt
43+
├── Dockerfile
44+
├── docker-compose.yml
45+
├── notebook/
46+
│ ├── 01-mmrag-blog-quick-start.ipynb # Jupyter notebook execution
4947
├── src/
5048
│ ├── embedding_generator.py # ImageBind wrapper
5149
│ ├── elastic_manager.py # Elasticsearch operations
@@ -60,6 +58,7 @@ docker compose run --no-deps --build --rm search-and-analyze
6058
├── audios/
6159
├── texts/
6260
└── depths/
61+
6362
```
6463

6564
## Sample Data
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Building a Multimodal RAG Pipeline with Elasticsearch: The Story of Gotham City
2+
3+
This repository contains the code for implementing a Multimodal Retrieval-Augmented Generation (RAG) system using Elasticsearch. The system processes and analyzes different types of evidence (images, audio, text, and depth maps) to solve a crime in Gotham City.
4+
5+
## Overview
6+
7+
The pipeline demonstrates how to:
8+
- Generate unified embeddings for multiple modalities using ImageBind
9+
- Store and search vectors efficiently in Elasticsearch
10+
- Analyze evidence using GPT-4 to generate forensic reports
11+
12+
## Prerequisites
13+
14+
- A Docker runtime with 8GB+ free ram
15+
- GPU is optional, but recommended
16+
- Elasticsearch cluster (cloud or local)
17+
- OpenAI API key - Setup an OpenAI account and create a [secret key](https://platform.openai.com/docs/quickstart)
18+
19+
## Quick Start
20+
21+
This example runs four stages as docker compose services:
22+
23+
```mermaid
24+
graph TD
25+
verify-file-structure --> generate-embeddings
26+
generate-embeddings --> index-content
27+
index-content --> search-and-analyze
28+
```
29+
30+
First, copy [env.example](env.example) to `.env` and fill in values noted inside.
31+
32+
33+
Edit the `.env` file and fill in your credentials:
34+
35+
```env
36+
# Elasticsearch Configuration
37+
ELASTICSEARCH_URL="https://your-elasticsearch-endpoint:443"
38+
ELASTICSEARCH_API_KEY="your-api-key"
39+
# If not using API key, uncomment these and fill them in:
40+
# ELASTICSEARCH_USER=elastic
41+
# ELASTICSEARCH_PASSWORD=elastic
42+
43+
# OpenAI Configuration
44+
OPENAI_API_KEY="your-openai-api-key"
45+
```
46+
47+
### 2. Configure Docker Resources
48+
49+
The ImageBind model requires significant memory. Ensure Docker has enough resources:
50+
51+
- **Memory**: At least 8GB (16GB recommended)
52+
- **Storage**: At least 10GB free space
53+
54+
For Docker Desktop users:
55+
1. Open Docker Desktop settings
56+
2. Go to Resources > Advanced
57+
3. Increase memory allocation to at least 8GB
58+
4. Apply & Restart
59+
60+
### 3. Running the Complete Pipeline
61+
62+
To run the entire pipeline from file structure verification to evidence analysis:
63+
64+
```bash
65+
docker compose run --build --rm search-and-analyze
66+
```
67+
68+
This command will:
69+
1. Build the Docker image if needed
70+
2. Run each stage in sequence
71+
3. Cache the ImageBind model weights for future runs
72+
73+
The first run will take longer as it builds the image and downloads model weights (~4.5GB).
74+
75+
### 4. Running Individual Stages
76+
77+
If you prefer to run each stage separately:
78+
79+
```bash
80+
# File structure verification
81+
docker compose run --build --rm verify-file-structure
82+
83+
# Generate embeddings
84+
docker compose run --build --rm generate-embeddings
85+
86+
# Index content in Elasticsearch
87+
docker compose run --build --rm index-content
88+
89+
# Search and analyze evidence
90+
docker compose run --build --rm search-and-analyze
91+
```
92+
93+
To skip dependency checks when running a specific stage:
94+
95+
```bash
96+
docker compose run --no-deps --build --rm search-and-analyze
97+
```

0 commit comments

Comments
 (0)