Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# VortexDB Demos

Example applications demonstrating VortexDB capabilities.

## Available Demos

### [clip-image-search](./clip-image-search/)

Real-time image search using natural language. Stack: CLIP + React + FastAPI

## Running a Demo

Each demo is self-contained with its own `docker-compose.yml`:

```bash
cd demo/<demo-name>
sudo docker compose up
```
34 changes: 34 additions & 0 deletions demo/clip-image-search/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Dependencies
node_modules/
__pycache__/
*.pyc
.venv/
venv/

# Build outputs
dist/
build/

# Images (downloaded separately)
backend/images/*.jpg
backend/images/*.jpeg
backend/images/*.png
backend/images/*.webp
backend/images/*.gif

# IDE
.idea/
.vscode/
*.swp
*.swo

# Logs
*.log

# Environment
.env
.env.local

# OS
.DS_Store
Thumbs.db
50 changes: 50 additions & 0 deletions demo/clip-image-search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CLIP Image Search Demo

A simple image search demo powered by **VortexDB** using CLIP embedding model.
Search images using natural language descriptions and see results update as you type.


## Quick Start


```bash
# From the demo directory
cd demo/clip-image-search

# Also downloads 100 demo images
sudo docker compose up
```
The setup container will:
1. Wait for CLIP and VortexDB to be ready
2. Download 100 sample images from Lorem Picsum
3. Vectorize and index them into VortexDB
4. Exit when complete

To change the number of images, edit `docker-compose.yml` and set `IMAGE_COUNT=50` (or any number).

### Manual Setup (Optional)

If you prefer to run setup separately:

```bash
# Start services only
sudo docker compose up -d clip-vectorizer vortexdb backend frontend

# Run setup manually with custom count
./setup.sh --count 50
```

## Adding Your Own Images

### Via the Backend API

```bash
# Index a single image
curl -X POST http://localhost:3001/index \
-F "file=@/path/to/your/image.jpg"
```

### Via the Setup Script

1. Copy images to `demo/clip-image-search/backend/images/`
2. Run `./setup.sh` (will index existing images without downloading new ones)
22 changes: 22 additions & 0 deletions demo/clip-image-search/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.11-slim

WORKDIR /app

# Install curl for healthcheck
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

COPY demo/clip-image-search/backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy and install VortexDB Python client
COPY client/python /tmp/vortexdb-client
RUN pip install --no-cache-dir /tmp/vortexdb-client && rm -rf /tmp/vortexdb-client

COPY demo/clip-image-search/backend/main.py .

# Create images directory
RUN mkdir -p /app/images

EXPOSE 3001

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3001"]
2 changes: 2 additions & 0 deletions demo/clip-image-search/backend/images/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Placeholder for sample images
# Run `./setup.sh` from the demo root to download sample images.
Loading
Loading