A Kubernetes-native application that synchronizes content from various sources (GitHub repositories, Confluence spaces) to OpenWebUI knowledge bases using an adapter architecture.
This project is licensed under the Apache License v2.0 - see the LICENSE file for details.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Data Sources │ │ Content Sync │ │ OpenWebUI │
│ • GitHub │───▶│ Application │───▶│ Knowledge │
│ • Confluence │ │ (Adapters) │ │ Base │
│ • Local Folders│ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Local Storage │
│ (PVC) │
└──────────────────┘
The connector integrates with OpenWebUI using the following APIs:
POST /api/v1/files/ - Upload files to OpenWebUIGET /api/v1/knowledge/ - List knowledge sourcesPOST /api/v1/knowledge/{id}/file/add - Add file to knowledgePOST /api/v1/knowledge/{id}/file/remove - Remove file from knowledgeUpdate the secrets in k8s/secrets.yaml:
# Encode your OpenWebUI API key
echo -n "your-openwebui-api-key" | base64
# Encode your GitHub token
echo -n "your-github-token" | base64
# Encode your Confluence API key
echo -n "your-confluence-api-key" | base64
Edit k8s/configmap.yaml to set:
- GitHub repositories to sync
- Confluence spaces or parent page IDs
- Knowledge IDs for file association
- Sync interval
# Apply all manifests
kubectl apply -f k8s/
# Check deployment status
kubectl get pods -l app=openwebui-content-sync
# Build the application
go build -o connector .
# Run with configuration
./connector -config config.yaml
The GitHub adapter syncs files from GitHub repositories to OpenWebUI knowledge bases.
Map different repositories to different knowledge bases:
github:
enabled: true
token: "ghp_your_github_token_here"
mappings:
- repository: "microsoft/vscode"
knowledge_id: "vscode-knowledge-base"
- repository: "facebook/react"
knowledge_id: "react-knowledge-base"
- repository: "your-org/your-repo"
knowledge_id: "your-custom-knowledge-base"
main or master)INFO[0000] Syncing files from adapter: github
DEBU[0000] Fetching files from repository: microsoft/vscode
DEBU[0000] Found 1,234 files in repository microsoft/vscode
INFO[0001] Successfully synced file: README.md
INFO[0001] Successfully synced file: package.json
INFO[0001] Successfully synced file: src/index.js
The Confluence adapter syncs pages from Confluence spaces to OpenWebUI knowledge bases.
Map different spaces and parent pages to different knowledge bases:
confluence:
enabled: true
base_url: "https://your-domain.atlassian.net"
username: "your-email@example.com"
api_key: "your-confluence-api-key"
# Space mappings (per-space knowledge IDs)
space_mappings:
- space_key: "DOCS"
knowledge_id: "docs-knowledge-base"
- space_key: "PRODUCT"
knowledge_id: "product-knowledge-base"
# Parent page mappings (per-parent-page knowledge IDs)
parent_page_mappings:
- parent_page_id: "1234567890"
knowledge_id: "parent-page-knowledge-base"
- parent_page_id: "0987654321"
knowledge_id: "another-parent-page-knowledge-base"
page_limit: 100 # Maximum pages to fetch per space (0 = no limit)
include_attachments: true # Whether to download and sync page attachments
call_summary_best_practices.txt)INFO[0000] Syncing files from adapter: confluence
DEBU[0000] Using PARENT PAGE mode - Processing 2 parent pages
DEBU[0000] Fetching files from Confluence parent page: 1234567890
DEBU[0000] Parent page: PoV Guide (Space: 2088140816)
DEBU[0000] Found 4 pages under parent page PoV Guide
DEBU[0000] Fetching files from Confluence parent page: 0987654321
DEBU[0000] Parent page: API Documentation (Space: 2088140816)
DEBU[0000] Found 3 pages under parent page API Documentation
INFO[0001] Successfully synced file: call_summary_best_practices.txt
INFO[0001] Successfully synced file: enabling_features_using_admin_apiconsole.txt
INFO[0001] Successfully synced file: api_endpoints_reference.txt
INFO[0001] Successfully synced file: authentication_guide.txt
Example Use Cases: - Map different GitHub repositories to different knowledge bases (e.g., frontend docs, backend docs, API docs) - Map different Confluence spaces to different knowledge bases (e.g., product docs, engineering docs, marketing docs) - Map specific parent pages to specialized knowledge bases (e.g., troubleshooting guides, user manuals, API references)
To find a Confluence page ID:
https://your-domain.atlassian.net/wiki/spaces/SPACEKEY/pages/1234567890/Page+Title1234567890Each uploaded file contains:
/spaces/SPACEKEY/pages/1234567890/Page+Title
[Page content converted from HTML to plain text]
The Local Folders adapter allows you to sync files from local directories to OpenWebUI knowledge bases. This is useful for syncing documentation, notes, or other local content.
Map different local folders to different knowledge bases:
local_folders:
enabled: true
mappings:
- folder_path: "/path/to/docs"
knowledge_id: "docs-knowledge-base"
- folder_path: "/path/to/guides"
knowledge_id: "guides-knowledge-base"
- folder_path: "/path/to/notes"
knowledge_id: "notes-knowledge-base"
.)INFO[0000] Syncing files from adapter: local
DEBU[0000] Fetching files from local folder: /path/to/docs
DEBU[0000] Found 15 files in folder /path/to/docs (knowledge_id: docs-knowledge-base)
INFO[0001] Successfully synced file: README.md
INFO[0001] Successfully synced file: installation.md
INFO[0001] Successfully synced file: api-reference.md
INFO[0001] Successfully synced file: subfolder/advanced-usage.md
The local folders adapter automatically ignores:
- Hidden files (starting with .)
- Binary files (detected by content analysis)
- Common system files: Thumbs.db, .DS_Store, desktop.ini
- Common development files: node_modules, __pycache__, .git, etc.
- Temporary files: *.log, *.tmp, *.temp, *.swp, *.swo
You can run GitHub, Confluence, and Local Folders adapters simultaneously:
github:
enabled: true
token: "your-github-token"
repositories:
- "your-org/docs"
knowledge_id: "docs-knowledge-base"
confluence:
enabled: true
base_url: "https://your-domain.atlassian.net"
username: "your-email@example.com"
api_key: "your-confluence-api-key"
parent_page_ids:
- "1234567890"
- "0987654321"
knowledge_id: "confluence-knowledge-base"
local_folders:
enabled: true
mappings:
- folder_path: "/path/to/local/docs"
knowledge_id: "local-knowledge-base"
The Jira adapter syncs Jira issues from specified projects to OpenWebUI knowledge bases.
Map different Jira projects to different knowledge bases:
jira:
enabled: true
base_url: "https://your-domain.atlassian.net"
username: "your-email@example.com"
api_key: "" # Set via JIRA_API_KEY environment variable
project_mappings:
- project_key: "PROJ"
knowledge_id: "project-knowledge-base"
- project_key: "ANOTHER"
knowledge_id: "another-knowledge-base"
{issue-key}.jsonINFO[0000] Syncing files from adapter: jira
DEBU[0000] Fetching files from Jira project: PROJ
DEBU[0000] Found 25 issues in Jira project PROJ
INFO[0001] Successfully synced file: PROJ-123.json
INFO[0001] Successfully synced file: PROJ-124.json
INFO[0001] Successfully synced file: PROJ-125.json
OPENWEBUI_BASE_URL: OpenWebUI instance URLOPENWEBUI_API_KEY: OpenWebUI API keyGITHUB_TOKEN: GitHub personal access tokenGITHUB_KNOWLEDGE_ID: OpenWebUI knowledge ID for GitHub filesCONFLUENCE_API_KEY: Confluence API keyCONFLUENCE_BASE_URL: Confluence instance URL (optional, can be set in config)CONFLUENCE_USERNAME: Confluence username (optional, can be set in config)CONFLUENCE_KNOWLEDGE_ID: OpenWebUI knowledge ID for Confluence filesJIRA_API_KEY: Jira API keySTORAGE_PATH: Local storage path (default: /data)LOG_LEVEL: Log level (debug, info, warn, error)log_level: info
schedule:
interval: 1h # Sync interval
storage:
path: /data
openwebui:
base_url: "http://localhost:8080"
api_key: ""
# GitHub adapter configuration
github:
enabled: true
token: "" # Set via GITHUB_TOKEN environment variable
repositories:
- "owner/repo1"
- "owner/repo2"
knowledge_id: "" # Set via GITHUB_KNOWLEDGE_ID environment variable
# Confluence adapter configuration
confluence:
enabled: false
base_url: "https://your-domain.atlassian.net"
username: "your-email@example.com"
api_key: "" # Set via CONFLUENCE_API_KEY environment variable
spaces:
- "SPACEKEY1"
- "SPACEKEY2"
parent_page_ids: [] # Optional: specific parent page IDs to process sub-pages only
knowledge_id: "" # Set via CONFLUENCE_KNOWLEDGE_ID environment variable
page_limit: 100 # Maximum pages to fetch per space (0 = no limit)
include_attachments: true # Whether to download and sync page attachments
# Jira adapter configuration
jira:
enabled: false
base_url: "https://your-domain.atlassian.net"
username: "your-email@example.com"
page_limit: 100 # Maximum pages to fetch per space (default = 100)
api_key: "" # Set via JIRA_API_KEY environment variable
project_mappings:
- project_key: "PROJ"
knowledge_id: "your-knowledge-base-id"
- project_key: "ANOTHER"
knowledge_id: "another-knowledge-base-id"
The application uses an adapter pattern to support multiple data sources:
```go type Adapter interface { Name() string FetchFiles(ctx context.Context) ([]*File, error) GetLastSync() tim
$ claude mcp add openwebui-content-sync \
-- python -m otcore.mcp_server <graph>