How to Connect Slack and Notion to an AI Assistant
Practical steps to integrate Slack and Notion with an AI assistant: API setup, retrieval architecture, and context assembly for production systems.
By Pulkit Verma, Founder & CEO, WeaveAI
Research and drafting assisted by WeaveAI Cite.
Connecting Slack and Notion to an AI assistant means configuring OAuth or API tokens for both platforms, building a retrieval layer that indexes Notion content, and deploying a bot in Slack that routes queries to your AI model with the right context attached. This setup lets teams ask questions about documentation, pull project updates, and trigger workflows without leaving their chat interface.
The integration serves two purposes: Slack becomes the conversational interface where users interact with the assistant, and Notion serves as the knowledge base the assistant retrieves from. Most implementations fail because they treat this as a simple API hookup rather than a retrieval problem—without proper chunking, embedding, and context assembly, the assistant either hallucinates or returns irrelevant pages.
Step 1: Set Up API Access for Slack and Notion
Start by creating a Slack app in your workspace and enabling the Bot Token Scopes you need: chat:write to send messages, app_mentions:read to listen for @mentions, and channels:history if the bot needs to read conversation context. Install the app to your workspace and save the Bot User OAuth Token.
For Notion, create an internal integration from the integrations page in your workspace settings. Grant it read access to the databases and pages your assistant will query. Each Notion page or database you want the assistant to access must be explicitly shared with the integration—Notion does not grant blanket access by default.
Store both tokens as environment variables or in a secrets manager. Never hardcode credentials or commit them to version control.
Step 2: Index Notion Content for Retrieval
An AI assistant cannot query Notion's API in real time for every user question—latency and rate limits make that impractical. Instead, you need to index Notion content into a vector database or search system that your assistant queries.
Pull all accessible pages and databases using Notion's API, then chunk the content into passages of 300-500 words. Each chunk should preserve enough context to be meaningful on its own: include the page title, database name, and any parent-page hierarchy. Generate embeddings for each chunk using a model like OpenAI's text-embedding-3-small or a self-hosted alternative, then store the embeddings in a vector database such as Pinecone, Weaviate, or Postgres with pgvector.
Set up a webhook or scheduled job to re-index content when Notion pages are updated. Notion does not offer native webhooks for all events, so many teams poll the API every few minutes or trigger re-indexing manually after major documentation changes.
Step 3: Build the Slack Bot Interface
Your Slack bot listens for events—typically app_mention or message events in channels where it's invited—and forwards the user's question to your AI assistant. Use Slack's Events API with a public HTTPS endpoint, or use Socket Mode if you want to avoid exposing a public URL.
When the bot receives a message, extract the user query, retrieve the most relevant Notion chunks from your vector database using semantic search, and assemble a prompt that includes the retrieved context plus the user's question. Send that prompt to your language model, then post the model's response back to the Slack thread.
Handle threading carefully: reply in the same thread where the user asked the question, and include a loading indicator or acknowledgment message if retrieval and generation take more than a few seconds. Users abandon assistants that feel unresponsive.
Step 4: Assemble Context and Route Queries
The quality of your assistant's answers depends on how you assemble context. Retrieve the top 3-5 most relevant chunks from Notion, rank them by embedding similarity, and concatenate them into a single context block. Prepend this block to your prompt with clear delimiters so the model knows which content is retrieved versus user-provided.
Include metadata in the context: page titles, last-updated timestamps, and links back to the source Notion page. This lets the assistant cite its sources and helps users verify answers. If no relevant chunks score above a similarity threshold, instruct the assistant to say it doesn't have enough information rather than guessing.
Route queries intelligently: some questions are purely informational ("What's our PTO policy?"), while others are commands ("Create a task in Notion for this"). Use intent classification or keyword matching to decide whether to retrieve from Notion, write back to Notion via its API, or hand off to a different workflow.
Step 5: Handle Authentication and Permissions
Notion's permission model is page-level, and your integration only sees pages explicitly shared with it. If a user asks about a page the integration cannot access, the assistant will fail silently or say it has no information. Communicate this limitation clearly in onboarding, and maintain a shared page or database that lists what the assistant can see.
Slack permissions are workspace-wide, but you can restrict which channels the bot joins. Invite the bot only to channels where it's useful, and configure event subscriptions to ignore DMs or private channels if your use case doesn't require them.
If your assistant needs to act on behalf of individual users—like creating Notion pages under their name—you'll need to implement OAuth flows for both Slack and Notion so each user authorizes the assistant separately. This adds complexity but is necessary for audit trails and fine-grained permissions.
Comparing Integration Approaches
Different architectural choices trade off latency, accuracy, and maintenance effort. The table below outlines the three most common approaches.
| Approach | Latency | Accuracy | Maintenance Effort | Best For |
|---|---|---|---|---|
| Real-time API queries | High (2-5 seconds per question) | Low (no semantic ranking) | Low | Prototypes and single-page lookups |
| Pre-indexed vector search | Low (<1 second) | High (semantic retrieval) | Medium (re-indexing jobs) | Production assistants with broad knowledge bases |
| Hybrid: vector + keyword fallback | Medium (1-2 seconds) | Highest (combines semantic and exact match) | High (two retrieval systems) | Complex use cases with structured and unstructured data |
Real-time API queries work for demos but break down when users ask open-ended questions across dozens of pages. Pre-indexed vector search is the standard for production systems. Hybrid retrieval adds keyword search as a fallback for exact phrases or structured data like dates and names, but requires maintaining two retrieval pipelines.
Common Failure Modes and How to Avoid Them
The most frequent failure is context overflow: the assistant retrieves too many chunks, exceeds the model's context window, and either truncates critical information or errors out. Set a hard limit on the number of chunks you include, and prioritize the highest-scoring results.
Stale content is the second most common issue. If your re-indexing job lags behind updates in Notion, the assistant answers questions with outdated information. Users lose trust quickly when the assistant contradicts what they see in Notion. Monitor your indexing lag and surface a warning if content is more than a few hours old.
Permission mismatches cause silent failures: the user asks about a page the integration cannot see, and the assistant says "I don't know" without explaining why. Log these events and periodically audit which pages are shared with the integration.
Finally, poor chunking degrades retrieval quality. If chunks are too large, they dilute the embedding signal and return irrelevant context. If chunks are too small, they lack enough information for the model to generate a useful answer. Test different chunk sizes and overlap strategies against a set of representative questions.
Monitoring and Iteration
Track three metrics: retrieval precision (what percentage of retrieved chunks are relevant), response accuracy (how often users accept the assistant's answer without follow-up), and usage frequency (how many questions per day per active user). Low retrieval precision means your embeddings or chunking strategy needs work. Low response accuracy suggests prompt engineering or model selection issues. Low usage frequency indicates the assistant isn't solving a real problem.
Collect feedback inline: add Slack reactions or buttons that let users mark answers as helpful or incorrect. Use this signal to build a dataset of questions and ground-truth answers, then fine-tune your retrieval or prompt over time.
Frequently Asked Questions
What permissions does the Slack bot need to answer questions from Notion?
The Slack bot needs chat:write to send messages, app_mentions:read to detect when users @mention it, and optionally channels:history if it needs to read prior conversation context. On the Notion side, your integration must be explicitly shared with every page or database the assistant will query—Notion does not grant workspace-wide read access by default. If a user asks about a page the integration cannot see, the assistant will have no context and cannot answer.
How do I keep the AI assistant's answers in sync with Notion updates?
Set up a scheduled job that polls Notion's API for recently modified pages, re-chunks the updated content, generates fresh embeddings, and updates your vector database. Notion does not offer comprehensive webhooks, so most teams poll every few minutes or trigger re-indexing manually after major documentation changes. Monitor the time lag between a Notion edit and when the assistant reflects that change, and surface a warning to users if indexed content is stale.
Can the assistant write back to Notion or only read from it?
The assistant can write back to Notion if you implement API calls that create or update pages and databases. Use intent classification to detect when a user is issuing a command like "Create a task for this" versus asking a question. Writing back requires careful permission management: decide whether the assistant acts under its own integration identity or on behalf of individual users via OAuth. Acting on behalf of users provides better audit trails but adds OAuth complexity.
Get Your AI Assistant Cited in AI Answers
Connecting Slack and Notion to an AI assistant gives your team conversational access to internal knowledge, but the same retrieval and context-assembly techniques apply to external content. WeaveAI builds autonomous AEO content engines that get B2B SaaS products cited in AI Overviews and LLM answers, using the same RAG architecture that powers reliable internal assistants. If you're building AI systems that need to keep working after the demo, reach out at weaveai.dev/products/seo.
Frequently asked questions
What permissions does the Slack bot need to answer questions from Notion?
The Slack bot needs `chat:write` to send messages, `app_mentions:read` to detect when users @mention it, and optionally `channels:history` if it needs to read prior conversation context. On the Notion side, your integration must be explicitly shared with every page or database the assistant will query—Notion does not grant workspace-wide read access by default. If a user asks about a page the integration cannot see, the assistant will have no context and cannot answer.
How do I keep the AI assistant's answers in sync with Notion updates?
Set up a scheduled job that polls Notion's API for recently modified pages, re-chunks the updated content, generates fresh embeddings, and updates your vector database. Notion does not offer comprehensive webhooks, so most teams poll every few minutes or trigger re-indexing manually after major documentation changes. Monitor the time lag between a Notion edit and when the assistant reflects that change, and surface a warning to users if indexed content is stale.
Can the assistant write back to Notion or only read from it?
The assistant can write back to Notion if you implement API calls that create or update pages and databases. Use intent classification to detect when a user is issuing a command like 'Create a task for this' versus asking a question. Writing back requires careful permission management: decide whether the assistant acts under its own integration identity or on behalf of individual users via OAuth. Acting on behalf of users provides better audit trails but adds OAuth complexity.
WeaveAI Cite
Get your business named in AI answers.
Cite finds the questions people ask AI about what you do, then writes and publishes the articles that answer them, on autopilot.
Weekly digest
New articles, once a week
What we published on agent readiness, retrieval and evals, in one email on Mondays. Nothing in weeks with nothing to send.