Skip to main content

Turn your Confluence docs into an AI chatbot in 5 minutes. Smart chunking, diagram support, and local or AWS deployment.

Project description

confluence-chatbot

Turn your Confluence docs into a searchable AI chatbot in 5 minutes.

confluence-chatbot ingests your Confluence spaces — text, tables, and architecture diagrams — into a local vector store, then answers questions using RAG (Retrieval-Augmented Generation) with source attribution.

Features

  • Smart chunking — splits by HTML headings, keeps tables whole, handles unstructured pages with paragraph-based fallback
  • Page context in embeddings — each chunk is prefixed with page title + section heading for better retrieval
  • Diagram understanding — uses a vision model (LLaVA or Claude Vision) to describe architecture diagrams as searchable text
  • Fully local — runs with FAISS + Ollama, zero cloud costs for development
  • Production-ready — swap to S3 Vectors + Bedrock for AWS deployment
  • Incremental sync — only re-processes pages that changed since last sync
  • Source attribution — every answer cites exactly which page and section it came from
  • Pluggable architecture — swap embedding models, vector stores, and LLMs without changing code

Quick Start

Install

pip install confluence-chatbot[all]

Configure

Create a .env file (see .env.example):

CONFLUENCE_URL=https://yourcompany.atlassian.net
CONFLUENCE_EMAIL=you@company.com
CONFLUENCE_API_TOKEN=your-api-token

Prerequisites

# Install and start Ollama (for local LLM)
brew install ollama
ollama serve  # in a separate terminal

# Pull the models
ollama pull llama3.1:8b    # for answer generation
ollama pull llava:13b      # for diagram description (optional)

Use as a Library

from confluence_chatbot import ConfluenceChatbot

rag = ConfluenceChatbot(
    confluence_url="https://yourcompany.atlassian.net",
    confluence_email="you@company.com",
    confluence_token="your-token",
    vector_store="faiss",
    embedding_model="BAAI/bge-large-en-v1.5",
    llm="ollama/llama3.1:8b",
)

# Ingest a space
rag.sync(spaces=["ENG"])

# Ask questions
answer = rag.ask("How does our caching layer work?")
print(answer.text)
print(answer.sources)

Use as CLI

# Sync a Confluence space
confluence-chatbot sync --space ENG

# Sync specific pages
confluence-chatbot sync --page-id 1234567890

# Force full re-sync (ignore cached state)
confluence-chatbot sync --space ENG --full

# Ask a question
confluence-chatbot ask "How does caching work?"

# Interactive mode
confluence-chatbot ask

Configuration Options

Parameter Default Description
vector_store "faiss" "faiss" (local) or "s3vectors" (AWS)
embedding_model "BAAI/bge-large-en-v1.5" Any sentence-transformers model or "bedrock/titan"
llm "ollama/llama3.1:8b" Ollama model or "bedrock/claude"
enable_image_description False Describe diagrams with vision model
image_model "llava:13b" Vision model for diagrams
top_k 8 Number of chunks to retrieve per query
s3_bucket_name "" S3 Vectors bucket (required for s3vectors)
s3_region "us-east-1" AWS region for S3 Vectors
s3_profile None AWS CLI profile name

How It Works

Confluence → Fetch pages → Smart chunk (text/tables/images)
                                    ↓
                         Embed (BAAI/bge-large-en-v1.5 or Bedrock Titan)
                                    ↓
                         Store in FAISS (local) or S3 Vectors (AWS)
                                    ↓
User question → Embed → Similarity search → Top-K chunks
                                    ↓
                         LLM generates grounded answer
                                    ↓
                         Answer + source citations

Install Options

# Lightweight (no local models, for use with Bedrock APIs)
pip install confluence-chatbot

# With local embedding model (BAAI, requires PyTorch ~800MB)
pip install confluence-chatbot[local]

# With local LLM via Ollama
pip install confluence-chatbot[ollama]

# Full local setup (recommended for development)
pip install confluence-chatbot[all]

Project Structure

src/confluence_chatbot/
├── core.py                  # Main ConfluenceChatbot orchestrator
├── models.py                # Data models (Page, Chunk, Answer)
├── cli.py                   # Command-line interface
├── ingest/
│   ├── confluence_client.py # Confluence API integration
│   ├── html_parser.py       # Parse Confluence HTML
│   ├── chunker.py           # Smart content-aware chunking
│   ├── image_describer.py   # Vision model for diagrams
│   └── sync_manager.py      # Incremental sync state tracking
├── embedding/
│   ├── base.py              # Abstract embedding interface
│   ├── sentence_transformer.py  # Local embedding (BAAI)
│   └── bedrock.py           # AWS Bedrock Titan Embeddings
├── vector_store/
│   ├── base.py              # Abstract vector store interface
│   ├── faiss_store.py       # Local FAISS implementation
│   └── s3_vectors.py        # AWS S3 Vectors implementation
└── generation/
    ├── base.py              # Abstract LLM interface
    ├── ollama_llm.py        # Local Ollama implementation
    └── bedrock_llm.py       # AWS Bedrock Claude implementation

Roadmap

  • v0.1 — Core pipeline: sync, chunk, embed, query, answer (local)
  • v0.2 — Incremental sync, Bedrock LLM + embeddings, improved chunking
  • v0.3 — Slack/Google Chat integration examples, evaluation tooling
  • v1.0 — Production deployment guide, CDK infrastructure template

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confluence_chatbot-0.2.0.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confluence_chatbot-0.2.0-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file confluence_chatbot-0.2.0.tar.gz.

File metadata

  • Download URL: confluence_chatbot-0.2.0.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for confluence_chatbot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bc6634ce8b1ba7f1d1d114abb8a894dd825d246788d801676760fd4035cc4566
MD5 1f428d388561ff3c1bf05ffc175f99de
BLAKE2b-256 99c3be4dac78164d52c12521114623c7877f7cdc4515a3296cd292332341d7cf

See more details on using hashes here.

File details

Details for the file confluence_chatbot-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for confluence_chatbot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac1f831e643e9db15aceda3b2a0c527b9d605fcf6f74057f36f7a0f329c28fe5
MD5 3c31eaeea206dd619b326d0132eee8aa
BLAKE2b-256 e7ab75c7e2b83dc6d2ae968895590ce91a94dffdbed0d24eaf85b1561261723a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page