diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c9b0827..9e149624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ - `true`: Tables preserved as markdown format with structure - **Chunking Configuration**: Additional chunking control options - New `chunking_merge_peers` config option (default: `true`) to merge undersized successive chunks +- **Docker Images**: Two Docker images for different deployment scenarios + - `haiku.rag`: Full image with all dependencies for self-contained deployments + - `haiku.rag-slim`: Minimal image designed for use with external docling-serve + - Multi-platform support (linux/amd64, linux/arm64) + - Docker Compose examples with docling-serve integration + - Automated CI/CD workflows for both images + - Build script (`scripts/build-docker-images.sh`) for local multi-platform builds ### Changed @@ -25,6 +32,10 @@ - Default tokenizer changed from tiktoken "gpt-4o" to "Qwen/Qwen3-Embedding-0.6B" - New `chunking_tokenizer` config option in `ProcessingConfig` for customization - `download-models` CLI command now also downloads the configured HuggingFace tokenizer +- **Docker Examples**: Updated examples to demonstrate remote processing + - `examples/docker` now uses slim image with docling-serve + - `examples/ag-ui-research` backend uses slim image with docling-serve + - Configuration examples include remote processing setup ## [0.16.1] - 2025-11-14 diff --git a/examples/ag-ui-research/README.md b/examples/ag-ui-research/README.md index 3b0d95b2..085222a5 100644 --- a/examples/ag-ui-research/README.md +++ b/examples/ag-ui-research/README.md @@ -23,6 +23,8 @@ Research assistant powered by [haiku.rag](https://ggozad.github.io/haiku.rag/), ### Setup 1. **Prepare your knowledge base** + + **Option A: Create a new database** ```bash mkdir -p data haiku-rag add "Your documents here" --db data/haiku_rag.lancedb @@ -30,6 +32,22 @@ Research assistant powered by [haiku.rag](https://ggozad.github.io/haiku.rag/), haiku-rag add-src document.pdf --db data/haiku_rag.lancedb ``` + **Option B: Use an existing database** + + Set the `DB_PATH` environment variable to point to your existing haiku.rag database: + ```bash + # In .env file + DB_PATH=/path/to/your/existing/haiku_rag.lancedb + ``` + + Or export it before running docker compose: + ```bash + export DB_PATH=/path/to/your/existing/haiku_rag.lancedb + docker compose up --build + ``` + + The database will be mounted as read-write, so the research assistant can access all documents in your existing knowledge base. + 2. **Configure haiku.rag** ```bash cp haiku.rag.yaml.example haiku.rag.yaml @@ -41,16 +59,17 @@ Research assistant powered by [haiku.rag](https://ggozad.github.io/haiku.rag/), ```bash cp .env.example .env # Edit .env to set your API keys - export OPENAI_API_KEY=your-key-here - export ANTHROPIC_API_KEY=your-key-here + OPENAI_API_KEY=your-key-here + ANTHROPIC_API_KEY=your-key-here + DB_PATH=/path/to/your/existing/haiku_rag.lancedb # If using an existing db. ``` -4. **Start the application** +1. **Start the application** ```bash docker compose up --build ``` -5. **Access the interface** +2. **Access the interface** - Frontend: http://localhost:3000 - Backend health: http://localhost:8000/health diff --git a/examples/ag-ui-research/backend/Dockerfile b/examples/ag-ui-research/backend/Dockerfile index 786c17db..e35af656 100644 --- a/examples/ag-ui-research/backend/Dockerfile +++ b/examples/ag-ui-research/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/ggozad/haiku.rag:latest +FROM ghcr.io/ggozad/haiku.rag-slim:latest WORKDIR /app @@ -6,7 +6,6 @@ WORKDIR /app COPY main.py agent.py ./ # Install additional dependencies for the example -# Note: haiku-rag-slim is already installed in the base image RUN pip install --no-cache-dir \ starlette>=0.45.2 \ uvicorn[standard]>=0.34.2 \ diff --git a/examples/ag-ui-research/docker-compose.yml b/examples/ag-ui-research/docker-compose.yml index 7cf7dd0c..5ea19039 100644 --- a/examples/ag-ui-research/docker-compose.yml +++ b/examples/ag-ui-research/docker-compose.yml @@ -1,4 +1,22 @@ services: + docling-serve: + image: quay.io/docling-project/docling-serve:latest + container_name: ag-ui-docling-serve + ports: + - "5001:5001" + environment: + - DOCLING_SERVE_ENABLE_UI=1 + networks: + - ag-ui-network + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + start_interval: 5s + backend: build: context: ./backend @@ -17,13 +35,13 @@ services: volumes: - ${DB_PATH}:/app/data/haiku.rag.lancedb - ./haiku.rag.yaml:/app/haiku.rag.yaml:ro - - ./backend/main.py:/app/main.py - - ./backend/agent.py:/app/agent.py - - ../../haiku_rag_slim/haiku:/app/.venv/lib/python3.13/site-packages/haiku networks: - ag-ui-network extra_hosts: - "host.docker.internal:host-gateway" + depends_on: + docling-serve: + condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] diff --git a/examples/ag-ui-research/haiku.rag.yaml.example b/examples/ag-ui-research/haiku.rag.yaml.example index 72dfee7b..dfd7ce7d 100644 --- a/examples/ag-ui-research/haiku.rag.yaml.example +++ b/examples/ag-ui-research/haiku.rag.yaml.example @@ -1,6 +1,21 @@ # haiku.rag configuration for ag-ui-research example # Copy to haiku.rag.yaml and customize +# Document processing with docling-serve +processing: + converter: docling-serve + chunker: docling-serve + chunk_size: 256 + chunker_type: hybrid + +providers: + docling_serve: + base_url: http://docling-serve:5001 + api_key: "" + timeout: 300 + ollama: + base_url: http://host.docker.internal:11434 + research: provider: ollama model: gpt-oss:latest @@ -8,10 +23,6 @@ research: confidence_threshold: 0.8 max_concurrency: 1 -providers: - ollama: - base_url: http://host.docker.internal:11434 - # For OpenAI: # research: # provider: openai