Prompt

How do I use RAG with Confluence pages and Slack messages?

Artificial Intelligence / AI Search1 observationLast seen Oct 10, 2026

Latest observation

Oct 10, 2026OpenAI APIWeb search: off

You can use RAG (Retrieval-Augmented Generation) with Confluence pages and Slack messages by turning both into searchable knowledge sources, retrieving the most relevant chunks at question time, and then passing those chunks to the LLM as context.

Basic architecture

  1. Ingest data
    • Pull Confluence pages via the Confluence API
    • Pull Slack messages via the Slack API
  2. Normalize and chunk
    • Clean HTML/markup
    • Split pages/messages into chunks
    • Attach metadata like:
      • source: confluence / slack
      • page/channel name
      • author
      • timestamp
      • URL
  3. Index
    • Create embeddings for each chunk
    • Store in a vector database
  4. Retrieve
    • When a user asks a question, embed the query
    • Find top-k relevant chunks from Confluence + Slack
  5. Generate
    • Put the retrieved chunks into the prompt
    • Ask the LLM to answer using only that context, with citations if possible

Practical setup

1) Connect to Confluence

Use the Confluence REST API to fetch:

  • page title
  • body content
  • labels
  • space key
  • last updated time
  • page URL

You’ll usually want to:

  • ignore archived/outdated pages
  • re-sync updated pages regularly
  • convert wiki/HTML content into plain text

2) Connect to Slack

Use the Slack Web API to fetch:

  • messages from relevant channels
  • threads and replies
  • pinned messages if useful

You’ll usually want to:

  • filter by channels relevant to the knowledge domain
  • avoid indexing private or sensitive channels unless explicitly allowed
  • include thread context so answers aren’t missing important replies

Chunking strategy

Confluence pages

Chunk by:

  • headings/sections
  • paragraphs
  • 300–800 tokens per chunk is a common range

Preserve structure:

  • page title
  • section heading path
  • URL

Slack messages

Slack data is noisy, so:

  • group message + replies into thread-level chunks
  • keep short context around the message
  • optionally summarize long threads before indexing

Example metadata:

{
  "source": "slack",
  "channel": "#prod-incidents",
  "thread_ts": "1712345678.000100",
  "author": "alice",
  "timestamp": "2024-03-12T10:15:00Z",
  "url": "https://slack.com/..."
}

Retrieval strategy

A good pattern is hybrid retrieval:

  • Vector search for semantic match
  • Keyword/BM25 search for exact terms, acronyms, ticket IDs, error codes

You can also:

  • boost newer Slack messages for operational questions
  • boost Confluence pages for canonical documentation
  • rank by recency, channel importance, and page labels

Prompting the LLM

When answering, provide:

  • the user question
  • retrieved chunks
  • instructions to cite sources and not invent facts

Example prompt style:

Use the provided Confluence and Slack excerpts to answer the question. If the answer is not in the context, say you don’t know. Cite source URLs or message references.


Example use cases

  • “How do I deploy service X?”
    • Confluence for docs
    • Slack for recent operational fixes
  • “What caused the incident last Tuesday?”
    • Slack incident channel threads
    • Confluence postmortem pages
  • “Who owns the payment API?”
    • Confluence ownership docs
    • Slack team channels for recent changes

Recommended stack

Ingestion

  • Python
  • Confluence REST API
  • Slack Web API

Embeddings

  • OpenAI embeddings or another embedding model

Vector store

  • pgvector / PostgreSQL
  • Pinecone
  • Weaviate
  • Milvus
  • Elasticsearch/OpenSearch vector fields

RAG framework

  • LangChain
  • LlamaIndex
  • Haystack

Important considerations

Permissions

Make sure retrieval respects source permissions:

  • only index content the user is allowed to see
  • filter results at query time by ACLs if needed

Freshness

Slack changes fast, Confluence changes slower:

  • Slack: frequent sync
  • Confluence: periodic sync + webhooks if available

Noise

Slack can be very noisy:

  • restrict by channels
  • deduplicate repeated info
  • prefer threaded discussions

Citations

Always store source references so the model can explain where an answer came from.


Simple implementation flow

  1. Fetch Confluence pages and Slack messages
  2. Convert to text
  3. Chunk and add metadata
  4. Embed and store in vector DB
  5. Query vector DB with user question
  6. Send top results to LLM
  7. Return answer + citations

If you want, I can also give you:

  • a Python example using LangChain or LlamaIndex
  • a system design diagram
  • a production checklist for permissions, syncing, and evaluation

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.