Open-source AI knowledge base for Confluence Data Center
Self-hosted. On-premise. Your data never leaves your network.
Install · Features · Architecture · Docs · Community · Security
Compendiq connects to your Confluence Data Center instance, syncs your pages, and gives you AI superpowers: ask questions across your entire knowledge base, improve articles with one click, generate new documentation from templates, and detect knowledge gaps -- all running on hardware you control.
Why this exists: Confluence Data Center has no native AI features. Cloud-only AI tools don't work for on-premise deployments. Compendiq fills that gap without sending a single byte to external servers (when using Ollama for local inference).
From zero to setup wizard with a single command:
curl -fsSL https://raw.githubusercontent.com/Compendiq/compendiq-ce/main/scripts/install.sh | bashRequirements: Docker Engine 24+ with Compose v2, 4 GB RAM, port 8081 free.
The installer generates cryptographic secrets, pulls images from GHCR, starts the stack (frontend, backend, PostgreSQL, Redis), and opens the setup wizard in your browser. Ollama must be running on the host for local AI inference.
What the installer does (step by step)
- Generates
JWT_SECRETandPAT_ENCRYPTION_KEY(AES-256, 32+ chars) - Writes
~/compendiq/docker-compose.ymlwith all secrets embedded - Pulls images from
ghcr.io/compendiq/compendiq-ce-* - Starts 4 containers: frontend (nginx), backend (Fastify), PostgreSQL 17 (pgvector), Redis 8
- Waits for the health endpoint (up to 3 min)
- Opens
http://localhost:8081-- the first-run wizard
Custom install directory / Ollama URL
# Custom install location
INSTALL_DIR=~/mydir curl -fsSL https://raw.githubusercontent.com/Compendiq/compendiq-ce/main/scripts/install.sh | bash
# Remote Ollama instance
OLLAMA_BASE_URL=http://my-gpu-server:11434 curl -fsSL ... | bashUninstall
bash ~/compendiq/uninstall.shStops containers, removes volumes, deletes the install directory.
Compendiq needs an embedding model and a chat model:
ollama pull bge-m3 # Required: embeddings (1024 dimensions)
ollama pull qwen3:4b # Or any chat model you preferAsk questions in natural language and get answers sourced from your Confluence pages. Powered by RAG with pgvector hybrid search (vector cosine similarity + full-text keyword search + Reciprocal Rank Fusion).
Select an article and improve it for grammar, structure, clarity, technical accuracy, or completeness. Generate new articles from templates (runbook, how-to, architecture, troubleshooting). Summarize long documents. Auto-tag pages with LLM classification.
Bidirectional sync with XHTML storage format conversion. Round-trip support for Confluence macros: code blocks, task lists, panels, user mentions, page links, draw.io diagrams (read-only rendering), Children Pages (expandable inline), and Attachments with download links.
| Category | What you get |
|---|---|
| Editor | TipTap v3 with Vim mode, drag-and-drop blocks, find-and-replace, image/table captions, header numbering, code block language detection, clipboard image paste |
| AI | Multi-provider LLM (Ollama default, or any OpenAI-compatible API), real-time SSE streaming, conversation history, content summarization, knowledge gap detection, duplicate page detection |
| Security | AES-256-GCM PAT encryption, JWT with refresh token rotation, RBAC with custom roles, OIDC/SSO (Enterprise), rate limiting, SSRF protection, prompt injection guard |
| Analytics | Page views, engagement metrics, search pattern tracking, knowledge graph visualization |
| Operations | PDF import/export, page verification workflow, knowledge requests, audit logging, OpenTelemetry tracing |
Confluence Data Center (XHTML Storage Format)
| REST API v1 (Bearer PAT)
v
Backend (Fastify 5 + TypeScript + Node.js 22)
|-- Sync Service ............ polls Confluence, stores in PostgreSQL
|-- Content Converter ....... XHTML <-> HTML <-> Markdown
|-- Embedding Service ....... chunks text, generates vectors via Ollama
|-- RAG Service ............. hybrid search (pgvector + FTS + RRF)
|-- Redis Cache ............. hot cache with TTL eviction
v
Frontend (React 19 + Vite + TailwindCSS 4)
|-- TipTap v3 Editor (HTML round-trip with Confluence macros)
|-- AI Assistant (SSE streaming)
|-- Glassmorphic UI (Radix UI + Framer Motion)
| Layer | Technology |
|---|---|
| Backend | Fastify 5, TypeScript, Node.js 22+ |
| Frontend | React 19, Vite 7, TailwindCSS 4, Radix UI, Zustand, TanStack Query, Framer Motion |
| Editor | TipTap v3 (ProseMirror) |
| Database | PostgreSQL 17 + pgvector |
| Cache | Redis 8 |
| AI/ML | Ollama (local) or OpenAI-compatible APIs, bge-m3 embeddings (1024 dims) |
| Auth | JWT (jose) + bcrypt + optional OIDC/SSO |
| Validation | Zod schemas shared via @compendiq/contracts |
| Testing | Vitest, Playwright, @testing-library/react |
| Infra | Docker Compose (4 services), multi-stage Dockerfiles, GHCR |
Confluence pages are synced over REST, converted from XHTML to HTML and Markdown, chunked and embedded for vector search, then served through a React frontend with a real-time AI chat interface. Every LLM call streams via Server-Sent Events. All data stays in your PostgreSQL database on your hardware.
Compendiq is open-core. The Community Edition (this repo) is fully functional under AGPL-3.0 with no artificial limits.
| Feature | Community (free) | Enterprise (paid) |
|---|---|---|
| Confluence sync + AI Q&A + article generation | Yes | Yes |
| RAG search (vector + keyword + hybrid) | Yes | Yes |
| Multi-provider LLM (Ollama, OpenAI, Azure, vLLM) | Yes | Yes |
| Rich text editor with Confluence macros | Yes | Yes |
| PDF import/export | Yes | Yes |
| RBAC with custom roles | Yes | Yes |
| Audit logging | Yes | Yes |
| OIDC/SSO | -- | Yes |
| Per-space RAG permissions | -- | Yes |
| Audit log export | -- | Yes |
| Priority support | -- | Yes |
Interested in Enterprise? Open an issue or reach out via GitHub Discussions.
Full local development setup
git clone https://github.com/Compendiq/compendiq-ce.git
cd compendiq-ce
npm installcp .env.example .env
# Edit .env -- set JWT_SECRET and PAT_ENCRYPTION_KEY to random 32+ char stringsdocker compose -f docker/docker-compose.yml up -d # PostgreSQL + Redisnpm run dev # Backend (3051) + Frontend (5273) with hot reloadOpen http://localhost:5273. First user gets admin role. Configure Confluence URL and PAT in Settings.
Running tests
npm test # All tests (contracts + backend + frontend)
npm run test -w backend # Backend only (needs PostgreSQL on port 5433)
npm run test -w frontend # Frontend only (jsdom)
npm run test:e2e # E2E (Playwright, needs running servers)
npm run lint # ESLint
npm run typecheck # TypeScript strict modeAll configuration is via environment variables. Key settings:
| Variable | Required | Description |
|---|---|---|
JWT_SECRET |
Yes | JWT signing secret (32+ characters) |
PAT_ENCRYPTION_KEY |
Yes | AES-256-GCM key for Confluence PATs (32+ characters) |
OLLAMA_BASE_URL |
-- | Ollama server URL (default: http://localhost:11434) |
EMBEDDING_MODEL |
-- | Embedding model (default: bge-m3) |
LLM_PROVIDER |
-- | ollama (default) or openai |
OPENAI_BASE_URL |
-- | OpenAI-compatible API URL (for Azure, LM Studio, vLLM, etc.) |
OPENAI_API_KEY |
-- | API key when using OpenAI provider |
POSTGRES_URL |
-- | PostgreSQL connection string |
REDIS_URL |
-- | Redis connection string |
Full configuration reference
| Variable | Default | Description |
|---|---|---|
JWT_SECRET |
-- | JWT signing secret (32+ chars, must not be default in production) |
PAT_ENCRYPTION_KEY |
-- | AES-256-GCM key for encrypting Confluence PATs (32+ chars) |
POSTGRES_USER |
kb_user |
PostgreSQL username |
POSTGRES_PASSWORD |
changeme-postgres |
PostgreSQL password |
POSTGRES_DB |
kb_creator |
PostgreSQL database name |
POSTGRES_URL |
postgresql://kb_user:changeme-postgres@localhost:5432/kb_creator |
Full connection string |
REDIS_PASSWORD |
changeme-redis |
Redis password |
REDIS_URL |
redis://:changeme-redis@localhost:6379 |
Full Redis connection string |
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama server URL |
EMBEDDING_MODEL |
bge-m3 |
Server-wide embedding model (1024 dimensions) |
LLM_PROVIDER |
ollama |
LLM provider: ollama or openai |
LLM_BEARER_TOKEN |
-- | Bearer token for authenticated Ollama/LLM proxies |
LLM_VERIFY_SSL |
true |
Set to false for self-signed LLM certs |
LLM_STREAM_TIMEOUT_MS |
300000 |
Streaming request timeout (ms) |
LLM_CACHE_TTL |
3600 |
Redis TTL for LLM cache (seconds) |
OPENAI_BASE_URL |
-- | OpenAI-compatible API base URL |
OPENAI_API_KEY |
-- | API key (required with openai provider) |
DEFAULT_LLM_MODEL |
-- | Fallback model for background workers |
SYNC_INTERVAL_MIN |
15 |
Confluence sync polling interval (minutes) |
CONFLUENCE_VERIFY_SSL |
true |
Set to false for self-signed Confluence certs |
NODE_ENV |
development |
development or production |
OTEL_ENABLED |
false |
Enable OpenTelemetry tracing |
OTEL_EXPORTER_OTLP_ENDPOINT |
-- | OTLP collector endpoint |
Interactive API documentation is available at /api/docs (Swagger UI) when the backend is running.
| Endpoint | Description |
|---|---|
GET /api/health |
Health checks (live, ready, start probes) |
POST /api/auth/* |
Register, login, refresh, logout |
GET/POST/PUT/DELETE /api/pages/* |
Page CRUD, versions, tags, embeddings, duplicates |
POST /api/llm/* |
AI operations (improve, generate, summarize, ask, chat) |
POST /api/sync |
Manual Confluence sync |
GET /api/search |
Keyword, semantic, and hybrid search |
GET/POST /api/admin/* |
Admin settings, audit log, RBAC, LLM config |
All endpoints except /api/health and /api/auth/* require a JWT Bearer token.
Contributions are welcome. See CONTRIBUTING.md for the full guide.
Quick version: branch from dev as feature/<description>, add tests, run npm test && npm run lint && npm run typecheck, open a PR to dev.
Found a vulnerability? Report it via GitHub Security Advisories (private channel). Do not open a public issue. See SECURITY.md for details.
GNU Affero General Public License v3.0
Built by a solo developer in Europe. If Compendiq saves your team time, star the repo -- it helps others find it.