๐Ÿš€Founding Member:First 1,000 users lock in50% off for lifeGet Started
Notion
Integrations
Product
Engineering

Why We Built Notion Integration (And What We Learned)

ErikJan 16, 20267 min read

Why We Built Notion Integration (And What We Learned)

I've been wrestling with a question for months: what actually belongs in AI memory?

Code context is obvious โ€” your AI needs to see the files you're working on. But there's this other category of knowledge that's harder to pin down: the decisions behind the code. Why you chose Postgres over Mongo. Why the auth flow works that way. Why there's a weird retry loop in the payment handler.

That knowledge exists. It's just not in your codebase. It's scattered across Notion pages, Slack threads, GitHub issues, and the heads of people who might not be on your team anymore.

So we built Notion integration. But the interesting part isn't that we built it โ€” it's the product and engineering decisions we had to make along the way.


The core tension: memory vs. noise

The naive approach to Notion integration would be: sync everything. Index every page, every database, every comment. Let the AI figure out what's relevant.

This is wrong for two reasons.

First, it's expensive. Not just in compute โ€” in attention. Every piece of context you add to an AI prompt competes for the model's focus. If you dump 50 Notion pages into context, you're diluting the signal with noise. The AI gets worse, not better.

Second, not everything in Notion is worth remembering. A meeting note about lunch preferences isn't the same as an architecture decision record. A task that says "fix button alignment" doesn't carry the same weight as a postmortem explaining why the payment system went down.

So the question becomes: how do you automatically distinguish signal from noise?


Smart type detection: our first attempt at solving this

We looked at hundreds of Notion databases across different teams. Patterns emerged.

A task database almost always has: Status, Due Date, sometimes Priority or Assignee.

A meeting database has: Date, Attendees, sometimes Agenda or Notes.

A wiki page doesn't live in a database at all โ€” or if it does, the database has minimal properties.

Bug reports tend to have: Severity, Priority, Status, maybe a Reporter field.

So we built a classifier. When we sync a Notion database, we look at its schema โ€” the properties it has โ€” and infer what type of content it contains. Not by reading the content itself, but by understanding the structure.

Database has Status + Due Date + Priority โ†’ probably tasks Database has Date + Attendees โ†’ probably meetings Database has Severity + Priority + Status โ†’ probably bug reports Standalone page outside a database โ†’ probably documentation

This lets us treat content differently. Tasks get indexed with their status and deadline as metadata. Meeting notes get timestamped so they're retrievable by "what did we discuss last week?" Bug reports get linked to code through their references.

It's not perfect. Someone could create a database with Status and Due Date that's actually tracking their reading list. But it's right often enough that the AI's context quality improves significantly.


The scoping problem: why "workspace sync" fails

Here's where it got interesting.

Initially, we thought about just syncing the whole Notion workspace. You connect Notion, and boom โ€” your AI knows everything.

But we quickly realized this is dangerous.

If you have a workspace that contains docs for Project A (a React Native app) and Project B (a Rust backend), and you ask the AI a question about Project A, a global sync might pull in architecture decisions from Project B.

Suddenly, the AI is hallucinating features that don't exist or suggesting patterns that contradict your current project's style.

So we made the harder choice: strict project scoping.

We force a mapping between Notion resources and specific projects. You explicitly tell the system: "This Notion database belongs to the ContextStream project."

  • The "Mobile App Tasks" database maps to the Mobile Repo
  • The "Backend API Specs" page maps to the Backend Repo
  • The "Company Values" page maps to Global Context

This ensures that when you're coding, the AI's context window is only filled with knowledge that is actually relevant to the codebase you have open. It reduces noise significantly and prevents cross-project contamination.


Bidirectional sync: why it matters

Read-only sync would have been easier to build. Just pull from Notion, index it, done.

But that misses something important.

When you're deep in a coding session and you discover a bug, the friction of context-switching to Notion to log it is high. High enough that people often don't do it. The bug gets fixed, but the knowledge of why it happened โ€” what caused it, what the symptoms were, how you diagnosed it โ€” that knowledge evaporates.

So we made it bidirectional. You can create Notion pages directly from your AI tools:

"Create a bug report: the OAuth refresh token wasn't being stored correctly because the expiry timestamp was in seconds but we were treating it as milliseconds"

The AI creates a properly structured page in your Notion bug reports database, with the right properties filled in. No context switch. The knowledge gets captured while it's fresh.

This is the part of the integration I'm most excited about. Not because the technology is complex โ€” it's actually pretty straightforward โ€” but because it changes behavior. It lowers the activation energy for capturing knowledge, which means more knowledge actually gets captured.


What we're not doing (yet)

I want to be honest about the limitations.

Real-time sync isn't there yet. When you update a page in Notion, it doesn't immediately reflect. We're polling periodically, which means there's a delay. Webhooks are coming, but they're not ready.

Property mapping is basic. We detect types, but we're not doing sophisticated mapping of Notion properties to our fields. A "Priority" dropdown in Notion doesn't automatically become a priority field on a task. That's on the roadmap.

Comments aren't indexed. Notion page comments often contain important context, but we're only indexing page content right now.


The broader point

Notion integration is part of a larger thesis we're building toward:

AI tools are only as good as the context they have access to.

Right now, most AI coding tools operate in isolation. They see your current file, maybe your current project, and that's it. They don't know what decisions led to the code being this way. They don't know what you tried before and why it didn't work. They don't know what your team has learned.

So they give generic advice. Or worse, they give advice that contradicts decisions your team already made.

The fix isn't smarter models โ€” it's better context. And "better context" means connecting the AI to the places where your team's actual knowledge lives.

For a lot of teams, that place is Notion.


Try it

If you're using ContextStream:

  1. Go to Integrations
  2. Connect Notion
  3. See what happens when your AI can reference your actual documentation

If you're not using ContextStream yet:

npx -y @contextstream/mcp-server setup

I'd love to hear what works and what doesn't. The feedback from the first few weeks of any integration is what shapes how it evolves.

โ†’ Notion docs โ†’ Get started

Ready to Give Your AI Perfect Memory?

Setup takes 2 minutes. Your AI remembers forever.