Syncs knowledge sources (Google Drive, Git repos) to OpenWebUI knowledge bases on a configurable schedule.
docker-compose.yml:services:
openwebui-knowledge-sync:
image: panarican/openwebui-knowledge-sync:latest
container_name: openwebui-knowledge-sync
restart: unless-stopped
env_file:
- .env
volumes:
- ./config.yml:/app/config.yml:ro
- ./keys:/app/keys:ro
- ./data:/app/data
- ./logs:/var/log/openwebui-knowledge-sync
.env file:# Required
OPENWEBUI_BASE_URL=https://your-openwebui-instance.com
OPENWEBUI_API_KEY=sk-your-api-key-here
# Optional
SYNC_CRON=0 3 * * *
TZ=America/New_York
Create a config.yml (see Configuration section below)
Run:
docker-compose up -d
docker run -d \
--name openwebui-knowledge-sync \
--env-file .env \
-v $(pwd)/config.yml:/app/config.yml:ro \
-v $(pwd)/keys:/app/keys:ro \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/var/log/openwebui-knowledge-sync \
--restart unless-stopped \
panarican/openwebui-knowledge-sync:latest
| Variable | Required | Default | Description |
|---|---|---|---|
OPENWEBUI_BASE_URL | ✅ | - | OpenWebUI instance URL |
OPENWEBUI_API_KEY | ✅ | - | OpenWebUI API key |
SYNC_CRON | ❌ | 0 3 * * * | Cron schedule (default: daily 3 AM) |
TZ | ❌ | America/New_York | Timezone for cron |
CONFIG_PATH | ❌ | ./config.yml | Path to config file |
RESET_KNOWLEDGE_BASES | ❌ | true | Clear KB before sync |
DELETE_ORPHAN_FILES | ❌ | true | Delete removed files |
DRY_RUN | ❌ | false | Preview without changes |
PARALLEL_SYNC | ❌ | false | Sync sources in parallel |
MAX_RETRIES | ❌ | 3 | Max retry attempts |
SYNC_CRON=0 3 * * * # Daily at 3 AM
SYNC_CRON=0 */6 * * * # Every 6 hours
SYNC_CRON=0 9,17 * * 1-5 # 9 AM and 5 PM weekdays
SYNC_CRON=*/30 * * * * # Every 30 minutes
knowledgeBases:
# Google Drive source
- name: "My Google Docs"
description: "Documentation from Google Drive"
source:
type: google-drive
folderId: "your-google-drive-folder-id"
keyFile: "./keys/google-service-account.json"
outputDir: "./data/knowledge-base/Google-Docs"
# Git repository source
- name: "My Wiki"
description: "GitLab wiki content"
source:
type: git
repo: "[email protected]:your-org/your-project.wiki.git"
keyFile: "./keys/id_gitlab"
shallow: true
outputDir: "./data/knowledge-base/My-Wiki"
| Path | Description |
|---|---|
/app/config.yml | Knowledge base configuration |
/app/data | Synced content (persistent) |
/app/keys | Service account & SSH keys |
/var/log/openwebui-knowledge-sync | Sync logs |
Run a sync manually (outside of cron schedule):
docker exec openwebui-knowledge-sync npm run sync
# Container logs
docker logs -f openwebui-knowledge-sync
# Sync logs
docker exec openwebui-knowledge-sync cat /var/log/openwebui-knowledge-sync/sync.log
Content type
Image
Digest
sha256:61265ff84…
Size
416.9 MB
Last updated
5 months ago
docker pull panarican/openwebui-knowledge-sync